Compare commits

...

5 Commits

Author SHA1 Message Date
c8860cec9d kf6: update KDE Gear to 24.08.0 2024-08-24 19:06:33 +06:00
a5c6bbeace kf6: update miscellanious software versions 2024-08-23 14:48:50 +06:00
c5b823899e kf6: update plasma to 6.1.4 2024-08-23 14:48:19 +06:00
1093cb0cdd kf6: update framework to 6.5.0 2024-08-23 14:47:27 +06:00
c4bdb5a213 gcc-toolset-14: initial build 2024-08-15 13:08:25 +06:00
510 changed files with 225053 additions and 560 deletions

View File

@ -0,0 +1,12 @@
diff -rup annobin.orig/gcc-plugin/annobin.cc annobin-12.52/gcc-plugin/annobin.cc
--- annobin.orig/gcc-plugin/annobin.cc 2024-05-07 10:17:35.673633775 +0100
+++ annobin-12.52/gcc-plugin/annobin.cc 2024-05-07 10:20:33.259026108 +0100
@@ -3209,7 +3209,7 @@ plugin_init (struct plugin_name_args *
{
annobin_inform (INFORM_ALWAYS, "Error: plugin built for compiler version (%s) but run with compiler version (%s)",
gcc_version.basever, version->basever);
- fail = true;
+ // fail = true;
}
/* Since the plugin is not part of the gcc project, it is entirely

View File

@ -0,0 +1,700 @@
%{?scl_package:%global scl gcc-toolset-14}
%global scl_prefix gcc-toolset-14-
BuildRequires: scl-utils-build
%global __python /usr/bin/python3
%{?scl:%scl_package annobin}
Name: %{?scl_prefix}annobin
Summary: Annotate and examine compiled binary files
Version: 12.65
Release: 4%{?dist}
License: GPL-3.0-or-later AND LGPL-2.0-or-later AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND GFDL-1.3-or-later
URL: https://sourceware.org/annobin/
# Maintainer: nickc@redhat.com
# Web Page: https://sourceware.org/annobin/
# Watermark Protocol: https://fedoraproject.org/wiki/Toolchain/Watermark
#---------------------------------------------------------------------------------
# Use "--without tests" to disable the testsuite.
%bcond_without tests
# Use "--without annocheck" to disable the installation of the annocheck program.
%bcond_without annocheck
# Use "--with debuginfod" to force support for debuginfod to be compiled into
# the annocheck program. By default the configure script will check for
# availablilty at build time, but this might not match the run time situation.
# FIXME: Add a --without debuginfod option to forcefully disable the configure
# time check for debuginfod support.
%bcond_with debuginfod
# Use "--without clangplugin" to disable the building of the annobin plugin for Clang.
%bcond_without clangplugin
# Use "--without gccplugin" to disable the building of the annobin plugin for GCC.
%bcond_without gccplugin
# Use "--without llvmplugin" to disable the building of the annobin plugin for LLVM.
%bcond_without llvmplugin
# Set this to zero to disable the requirement for a specific version of gcc.
# This should only be needed if there is some kind of problem with the version
# checking logic or when building on RHEL-7 or earlier.
#
# Update: now that we have gcc version checking support in redhat-rpm-config
# there is no longer a great need for a hard gcc version check here. Not
# enabling this check greatly simplifies the process of installing a new major
# version of gcc into the buildroot.
%global with_hard_gcc_version_requirement 0
%bcond_without plugin_rebuild
# Allow the building of annobin without using annobin itself.
# This is because if we are bootstrapping a new build environment we can have
# a new version of gcc installed, but without a new of annobin installed.
# (i.e. we are building the new version of annobin to go with the new version
# of gcc). If the *old* annobin plugin is used whilst building this new
# version, the old plugin will complain that version of gcc for which it
# was built is different from the version of gcc that is now being used, and
# then it will abort.
#
# The default is to use plugin during rebuilds (cf BZ 1630550) but this can
# be changed because of the need to be able to rebuild annobin when a change
# to gcc breaks the version installed into the buildroot. Note however that
# uncommenting the lines below will result in annocheck not passing the rpminspect
# tests....
# %%if %%{without plugin_rebuild}
# %%undefine _annotated_build
# %%endif
#---------------------------------------------------------------------------------
# Bootstrapping: Set this to 1 to build annobin with the system gcc.
# Then once GTS-gcc is built and in the buildroot, reset this variable
# to 0, bump the NVR and rebuild GTS-annobin.
%define bootstrapping 1
#---------------------------------------------------------------------------------
%global annobin_sources annobin-%{version}.tar.xz
Source: https://nickc.fedorapeople.org/%{annobin_sources}
# For the latest sources use: git clone git://sourceware.org/git/annobin.git
# Insert patches here, if needed. Eg:
%if %{bootstrapping}
Patch01: annobin-gcc-plugin-ignore-major-version-diffs.patch
%endif
# This is where a copy of the sources will be installed.
%global annobin_source_dir %{?_scl_root}/%{_usrsrc}/annobin
%if %{bootstrapping}
BuildRequires: gcc gcc-c++
%define gcc_for_annobin /usr/bin/gcc
%define gxx_for_annobin /usr/bin/g++
%else
BuildRequires: %{scl_prefix}gcc
BuildRequires: %{scl_prefix}gcc-c++
BuildRequires: %{scl_prefix}annobin-plugin-gcc
BuildRequires: %scl_runtime
Requires: %scl_runtime
# We need the gcc-toolset-N version of gcc in order to run annobin, as otherwise the versions will not match.
Requires: %scl_require_package %{scl} gcc
%define gcc_for_annobin %{_scl_root}/usr/bin/gcc
%define gxx_for_annobin %{_scl_root}/usr/bin/g++
%endif
#---------------------------------------------------------------------------------
# Make sure that the necessary sub-packages are built.
%if %{with gccplugin}
Requires: %{name}-plugin-gcc
%endif
%if %{with llvmplugin}
Requires: %{name}-plugin-llvm
%endif
%if %{with clangplugin}
Requires: %{name}-plugin-clang
%endif
#---------------------------------------------------------------------------------
%description
This package contains the tools needed to annotate binary files created by
compilers, and also the tools needed to examine those annotations.
%if %{with gccplugin}
One of the tools is a plugin for GCC that records information about the
security options that were in effect when the binary was compiled.
Note - the plugin is automatically enabled in gcc builds via flags
provided by the redhat-rpm-macros package.
%endif
%if %{with clangplugin}
One of the tools is a plugin for Clang that records information about the
security options that were in effect when the binary was compiled.
%endif
%if %{with llvmplugin}
One of the tools is a plugin for LLVM that records information about the
security options that were in effect when the binary was compiled.
%endif
%if %{with annocheck}
One of the tools is a security checker which analyses the notes present in
annotated files and reports on any missing security options.
%endif
#---------------------------------------------------------------------------
# Now that we have sub-packages for all of the plugins and for annocheck,
# there are no executables left to go into the "annobin" rpm. But top-level
# packages cannot have "BuildArch: noarch" if sub-packages do have
# architecture requirements, and rpmlint generates an error if an
# architecture specific rpm does not contain any binaries. So instead all of
# the documentation has been moved into an architecture neutral sub-package,
# and there no longer is a top level annobin rpm at all.
%package docs
Summary: Documentation and shell scripts for use with annobin
BuildArch: noarch
# The documentation uses pod2man...
BuildRequires: perl-interpreter perl-podlators gawk make sharutils
%description docs
Provides the documentation files and example shell scripts for use with annobin.
#----------------------------------------------------------------------------
%if %{with tests}
%package tests
Summary: Test scripts and binaries for checking the behaviour and output of the annobin plugin
Requires: %{name}-docs = %{version}-%{release}
BuildRequires: make sharutils
%if %{with debuginfod}
BuildRequires: elfutils-debuginfod-client-devel
%endif
%description tests
Provides a means to test the generation of annotated binaries and the parsing
of the resulting files.
%endif
#----------------------------------------------------------------------------
%if %{with annocheck}
%package annocheck
Summary: A tool for checking the security hardening status of binaries
BuildRequires: elfutils elfutils-devel elfutils-libelf-devel rpm-devel make
%if %{bootstrapping}
BuildRequires: gcc
%else
BuildRequires: %{?scl_prefix}gcc
%endif
%if %{with debuginfod}
BuildRequires: elfutils-debuginfod-client-devel
%endif
Requires: %{name}-docs = %{version}-%{release}
Requires: cpio rpm
%description annocheck
Installs the annocheck program which uses the notes generated by annobin to
check that the specified files were compiled with the correct security
hardening options.
%package libannocheck
Summary: A library for checking the security hardening status of binaries
BuildRequires: elfutils elfutils-devel elfutils-libelf-devel rpm-devel make
%if %{bootstrapping}
BuildRequires: gcc
%else
BuildRequires: %{?scl_prefix}gcc
%endif
%if %{with debuginfod}
BuildRequires: elfutils-debuginfod-client-devel
%endif
Requires: %{name}-docs = %{version}-%{release}
%description libannocheck
Installs the libannocheck library which uses the notes generated by the
annobin plugins to check that the specified files were compiled with the
correct security hardening options.
%endif
#----------------------------------------------------------------------------
%if %{with gccplugin}
%package plugin-gcc
Summary: annobin gcc plugin
Requires: %{name}-docs = %{version}-%{release}
%if %{bootstrapping}
BuildRequires: gcc-c++ gcc-plugin-devel
%else
BuildRequires: %{?scl_prefix}gcc-c++ %{?scl_prefix}gcc-plugin-devel
%endif
# [Stolen from gcc-python-plugin]
# GCC will only load plugins that were built against exactly that build of GCC
# We thus need to embed the exact GCC version as a requirement within the
# metadata.
#
# Define "gcc_vr", a variable to hold the VERSION-RELEASE string for the gcc
# we are being built against.
#
# Unfortunately, we can't simply run:
# rpm -q --qf="%%{version}-%%{release}"
# to determine this, as there's no guarantee of a sane rpm database within
# the chroots created by our build system
#
# So we instead query the version from gcc's output.
#
# gcc.spec has:
# Version: %%{gcc_version}
# Release: %%{gcc_release}%%{?dist}
# ...snip...
# echo 'Red Hat %%{version}-%%{gcc_release}' > gcc/DEV-PHASE
#
# So, given this output:
#
# $ gcc --version
# gcc (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9)
# Copyright (C) 2011 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# we can scrape out the "4.6.1" from the version line.
#
# The following implements the above:
%global gcc_vr %(%gcc_for_annobin --version | head -n 1 | sed -e 's|.*(Red\ Hat\ ||g' -e 's|)$||g')
# We need the major version of gcc.
%global gcc_major %(echo "%{gcc_vr}" | cut -f1 -d".")
%global gcc_next %(v="%{gcc_major}"; echo $((++v)))
# Needed when building the srpm.
%if 0%{?gcc_major} == 0
%global gcc_major 0
%endif
# For a gcc plugin gcc is required.
%if %{bootstrapping}
Requires: gcc
%else
%if %{with_hard_gcc_version_requirement}
# BZ 1607430 - There is an exact requirement on the major version of gcc.
Requires: (%{?scl_prefix}gcc >= %{gcc_major} with %{?scl_prefix}gcc < %{gcc_next})
%else
Requires: %{?scl_prefix}gcc
%endif
%endif
# Information about the gcc plugin is recorded in this file.
%global aver annobin-plugin-version-info
%description plugin-gcc
Installs an annobin plugin that can be used by gcc.
%endif
#---------------------------------------------------------------------------------
%if %{with llvmplugin}
%package plugin-llvm
Summary: annobin llvm plugin
Requires: %{name}-docs = %{version}-%{release}
Requires: llvm-libs
Conflicts: %{name} <= 9.60-1
BuildRequires: clang clang-devel llvm llvm-devel compiler-rt
%description plugin-llvm
Installs an annobin plugin that can be used by LLVM tools.
%endif
#---------------------------------------------------------------------------------
%if %{with clangplugin}
%package plugin-clang
Summary: annobin clang plugin
Requires: %{name}-docs = %{version}-%{release}
Requires: llvm-libs
Conflicts: %{name} <= 9.60-1
BuildRequires: clang clang-devel llvm llvm-devel compiler-rt
%description plugin-clang
Installs an annobin plugin that can be used by Clang.
%endif
#---------------------------------------------------------------------------------
# Decide where the plugins will live. Change if necessary.
%if %{bootstrapping}
# If we are bootstrapping then we will be using the system gcc. But we do
# not want to install the newly built GTS-14 annobin plugin into the system
# plugin directory. So we hard code a path here.
# FIXME: This is going to need to be updated every time we bootstrap. Find
# a better way.
%global GTS_GCC_MAJOR_VERSION 14
%global ANNOBIN_GCC_PLUGIN_DIR %{_scl_root}/usr/lib/gcc/x86_64-redhat-linux/%{GTS_GCC_MAJOR_VERSION}/plugin
%else
%global ANNOBIN_GCC_PLUGIN_DIR %(%gcc_for_annobin --print-file-name=plugin)
%endif
%{!?llvm_plugin_dir:%global llvm_plugin_dir %{_libdir}/llvm/plugins}
%{!?clang_plugin_dir:%global clang_plugin_dir %{_libdir}/clang/plugins}
#---------------------------------------------------------------------------------
%prep
if [ -z "%{gcc_vr}" ]; then
echo "*** Missing gcc_vr spec file macro, cannot continue." >&2
exit 1
fi
echo "Requires: (%{?scl_prefix}gcc >= %{gcc_major} and %{?scl_prefix}gcc < %{gcc_next})"
# NB/ Do not add {?scl_prefix} to the -n option below. The annobin sources
# unpack into a directory called annobin-VERSION not gcc-toolset-14-annobin-VERSION.
%autosetup -p1 -n annobin-%{version}
# The plugin has to be configured with the same arcane configure
# scripts used by gcc. Hence we must not allow the Fedora build
# system to regenerate any of the configure files.
touch aclocal.m4 gcc-plugin/config.h.in
touch configure */configure Makefile.in */Makefile.in
# Similarly we do not want to rebuild the documentation.
touch doc/annobin.info
#---------------------------------------------------------------------------------
%build
CONFIG_ARGS="--quiet"
%if %{with debuginfod}
CONFIG_ARGS="$CONFIG_ARGS --with-debuginfod"
%else
# Note - we explicitly disable debuginfod support if it was not configured.
# This is because by default annobin's configue script will assume --with-debuginfod=auto
# and then run a build time test to see if debugingfod is available. It
# may well be, but the build time environment may not match the run time
# environment, and the rpm will not have a Requirement on the debuginfod
# client.
CONFIG_ARGS="$CONFIG_ARGS --without-debuginfod"
%endif
%if %{without clangplugin}
CONFIG_ARGS="$CONFIG_ARGS --without-clang-plugin"
%endif
%if %{without gccplugin}
CONFIG_ARGS="$CONFIG_ARGS --without-gcc-plugin"
%else
CONFIG_ARGS="$CONFIG_ARGS --with-gcc-plugin-dir=%{ANNOBIN_GCC_PLUGIN_DIR}"
%endif
%if %{without llvmplugin}
CONFIG_ARGS="$CONFIG_ARGS --without-llvm-plugin"
%endif
%if %{without tests}
CONFIG_ARGS="$CONFIG_ARGS --without-tests"
%endif
%if %{without annocheck}
CONFIG_ARGS="$CONFIG_ARGS --without-annocheck"
%else
# Fedora and RHEL-10 support AArch64's -mbranch-protection=bti, RHEL-9 does not.
%if 0%{?fedora} != 0
export CFLAGS="$CFLAGS -DAARCH64_BRANCH_PROTECTION_SUPPORTED=1"
%endif
%endif
%set_build_flags
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS %build_cflags -I%{?_scl_root}/usr/include"
export LDFLAGS="$LDFLAGS %build_ldflags -L%{?_scl_root}/usr/lib64 -L%{?_scl_root}/usr/lib"
# Set target-specific options to be used when building the Clang and LLVM plugins.
# FIXME: There should be a better way to do this.
%ifarch %{ix86} x86_64
export CLANG_TARGET_OPTIONS="-fcf-protection"
%endif
%ifarch aarch64
export CLANG_TARGET_OPTIONS="-mbranch-protection=standard"
%endif
%ifnarch riscv64
export CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS -flto"
%endif
# # Override the default fortification level used by the Clang and LLVM plugins.
# export PLUGIN_FORTIFY_OPTION="-D_FORTIFY_SOURCE=3"
CC=%gcc_for_annobin CXX=%gxx_for_annobin CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CXXFLAGS="$CFLAGS" %configure ${CONFIG_ARGS} || cat config.log
%make_build
%if %{with plugin_rebuild}
# Rebuild the plugin(s), this time using the plugin itself! This
# ensures that the plugin works, and that it contains annotations
# of its own.
%if %{with gccplugin}
cp gcc-plugin/.libs/annobin.so.0.0.0 %{_tmppath}/tmp_annobin.so
make -C gcc-plugin clean
BUILD_FLAGS="-fplugin=%{_tmppath}/tmp_annobin.so"
# Disable the standard annobin plugin so that we do get conflicts.
# Note - rpm-4.10 uses a different way of evaluating macros.
%if 0%{?rhel} && 0%{?rhel} < 9
OPTS="$(rpm --eval '%undefine _annotated_build %build_cflags %build_ldflags')"
%else
OPTS="$(rpm --undefine=_annotated_build --eval '%build_cflags %build_ldflags')"
%endif
# If building on systems with an assembler that does not support the
# .attach_to_group pseudo op (eg RHEL-7) then enable the next line.
# BUILD_FLAGS="$BUILD_FLAGS -fplugin-arg-tmp_annobin-no-attach"
make -C gcc-plugin CXX=%gxx_for_annobin CXXFLAGS="$OPTS $BUILD_FLAGS"
rm %{_tmppath}/tmp_annobin.so
%endif
%if %{with clangplugin}
cp clang-plugin/annobin-for-clang.so %{_tmppath}/tmp_annobin.so
# To enable verbose more in the plugin append the following: ANNOBIN="verbose"
make -C clang-plugin clean all CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS $BUILD_FLAGS"
%endif
%if %{with llvmplugin}
cp llvm-plugin/annobin-for-llvm.so %{_tmppath}/tmp_annobin.so
# To enable verbose more in the plugin append the following: ANNOBIN_VERBOSE="true"
make -C llvm-plugin clean all CLANG_TARGET_OPTIONS="$CLANG_TARGET_OPTIONS $BUILD_FLAGS"
%endif
# endif for %%if {with_plugin_rebuild}
%endif
#---------------------------------------------------------------------------------
%install
# PLUGIN_INSTALL_DIR is used by the Clang and LLVM makefiles...
%make_install PLUGIN_INSTALL_DIR=%{buildroot}/%{llvm_plugin_dir}
%if %{with clangplugin}
# Move the clang plugin to a seperate directory.
mkdir -p %{buildroot}/%{clang_plugin_dir}
mv %{buildroot}/%{llvm_plugin_dir}/annobin-for-clang.so %{buildroot}/%{clang_plugin_dir}
%endif
%if %{with gccplugin}
# Record the version of gcc that built this plugin.
# Note - we cannot just store %%{gcc_vr} as sometimes the gcc rpm version changes
# without the NVR being altered. See BZ #2030671 for more discussion on this.
mkdir -p %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR}
cat `%gcc_for_annobin --print-file-name=rpmver` > %{buildroot}/%{ANNOBIN_GCC_PLUGIN_DIR}/%{aver}
# Also install a copy of the sources into the build tree.
mkdir -p %{buildroot}%{annobin_source_dir}
cp %{_sourcedir}/%{annobin_sources} %{buildroot}%{annobin_source_dir}/latest-annobin.tar.xz
%endif
rm -f %{buildroot}%{_infodir}/dir
# When annocheck is disabled, annocheck.1.gz will still be generated, remove it.
%if %{without annocheck}
rm -f %{_mandir}/man1/annocheck.1.gz
%endif
#---------------------------------------------------------------------------------
%if %{with tests}
%check
# The first "make check" is run with "|| :" so that we can capture any logs
# from failed tests. The second "make check" is there so that the build
# will fail if any of the tests fail.
make check GCC=%gcc_for_annobin || :
if [ -f tests/test-suite.log ]; then
cat tests/test-suite.log
fi
# If necessary use uuencode to preserve test binaries here. For example:
# uuencode tests/tmp_atexit/atexit.strip atexit.strip
# Now repeat the tests so that we get the correct exit code.
make check GCC=%gcc_for_annobin
%endif
#---------------------------------------------------------------------------------
%files docs
%license COPYING3 LICENSE
%exclude %{_datadir}/doc/annobin-plugin/COPYING3
%exclude %{_datadir}/doc/annobin-plugin/LICENSE
%doc %{_datadir}/doc/annobin-plugin/annotation.proposal.txt
%{_infodir}/annobin.info*
%{_mandir}/man1/annobin.1*
%exclude %{_mandir}/man1/built-by.1*
%exclude %{_mandir}/man1/check-abi.1*
%exclude %{_mandir}/man1/hardened.1*
%exclude %{_mandir}/man1/run-on-binaries-in.1*
%if %{with llvmplugin}
%files plugin-llvm
%dir %{llvm_plugin_dir}
%{llvm_plugin_dir}/annobin-for-llvm.so
%endif
%if %{with clangplugin}
%files plugin-clang
%dir %{clang_plugin_dir}
%{clang_plugin_dir}/annobin-for-clang.so
%endif
%if %{with gccplugin}
%files plugin-gcc
%dir %{ANNOBIN_GCC_PLUGIN_DIR}
%{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so
%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so
%{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0
%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0
%{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0.0.0
%verify(owner) %{ANNOBIN_GCC_PLUGIN_DIR}/annobin.so.0.0.0
%{ANNOBIN_GCC_PLUGIN_DIR}/%{aver}
%{annobin_source_dir}/latest-annobin.tar.xz
%endif
%if %{with annocheck}
%files annocheck
%{_bindir}/annocheck
%{_mandir}/man1/annocheck.1*
%files libannocheck
%{_includedir}/libannocheck.h
%{_libdir}/libannocheck.*
%{_libdir}/pkgconfig/libannocheck.pc
%endif
#---------------------------------------------------------------------------------
%changelog
* Wed Aug 07 2024 Nick Clifton <nickc@redhat.com> - 12.65-4
- Spec File: Change bootstrap gcc version to 14. (RHEL-53209)
* Thu Aug 01 2024 Nick Clifton <nickc@redhat.com> - 12.65-3
- Spec File: Remove scl-runtime requirement when bootstrapping.
* Thu Aug 01 2024 Nick Clifton <nickc@redhat.com> - 12.65-2
- Spec File: Remove spurious dash from install path of gcc plugin. (RHEL-51183)
* Tue Jul 30 2024 Nick Clifton <nickc@redhat.com> - 12.65-1
- Rebase to 12.65. (RHEL-51056)
- Annocheck: Fix recording arguments for later re-use. (RHEL-50802)
- GCC Plugin: Fix building AArch64 components with gcc earlier than 11.3.
- Annocheck: Add improvements to the builtby utility.
- Annocheck: Add support for ADA binaries.
- Annocheck: Add support for binaries built from more than two high level source languages.
- Annocheck: Add support for object files containing no executable code.
- Annocheck: Do not FAIL LLVM compiled binaries that have not been built with sanitize-cfi and/or sanitize-safe-stack.
- Annocheck: Add support for Fortran binaries.
- Annocheck: Add heuristic for detecting parts of the CGO runtime library.
- Annocheck: Add improvements for handling Clang runtime binaries.
- Annocheck: Add tweaks for mixed Rust/C binaries. (#2284605)
- Annocheck: Add more glibc source file names.
- Annocheck: Skip GAPS test for GO binaries. (RHEL-36308)
- Annocheck: Remove some false positives for Rust binaries. (#2280239)
- Annocheck: Defer passing the branch protection test until all notes have been checked.
- GCC Plugin: Add extra code for detecting the branch protection setting. (RHEL-35958)
* Fri Jul 26 2024 Nick Clifton <nickc@redhat.com> - 12.52-5
- Spec File: Hard code the gcc plugin directory when boostrapping. (RHEL-50148)
* Mon Jul 22 2024 Nick Clifton <nickc@redhat.com> - 12.52-4
- Rebuild with LLVM 18. (RHEL-49955)
* Fri May 03 2024 Nick Clifton <nickc@redhat.com> - 12.52-2
- Disable version checks in gcc plugin.
* Fri Apr 26 2024 Nick Clifton <nickc@redhat.com> - 12.52-1
- Initial import of sources.
- Compared to GTS-13 annobin (12.32) the improvements are:
- Annocheck: Add OpenSSL Engine test. (PTG-319)
- Annocheck: Test for gaps even when only one note is present.
- Annocheck: Skip AArch64 branch protection test for GO binaries.
- GCC Plugin: Disable active check for -Wimplicit-int for non-C sources. (#2275884)
- Annocheck: Ignore stack checks for AMD GPU binaries.
- Annocheck: Do not produce FAIL result for i686 binaries in the RHEL-10 profile.
- Annocheck: Test for __stack_chk_guard being writeable.
- Annocheck: Update heuristics for detecting glibc code in executables. (RHEL-30579)
- Clang & LLVM Plugins: Allow environment to override fortification level. (RHEL-30579)
- Spec File: Override fortification level and set it to 3.
- Annocheck: Improve detection of -mbranch-protection option.
- Clang Plugin: Add global-file-syms option.
- LLVM Plugin: Add global-file-syms option.
- Plugins: Add support for ANNOBIN environment variable.
- GCC Plugin: Fix bug extracing the value of target specific command line options.
- Configure: Remove check for FrontendPluginRegistry.h header as it is stored in a non-standard location on Debian systems.
- Debuginfod test: Allow for the libdwfl library silently contacting the debuginfod server.
- LLVM Plugin: Use llvm-config to get the correct paths and options for building executables.
- Clang Plugin: Likewise.
- Enable silent rules for most building.
- Annocheck: Correctly extract DWARF attributes from DT_REL files.
- Annocheck: Improve heuristics for locating debug info files. (#2267097)
- Configure: Harmonize configure options.
- Clang Plugin: Fix building with Clang 18. (#31414)
- GCC Plugin: Add support for MIPS specific target functions.
- GCC Plugin: Use .dc.a for address expressions in 64-bit ELF format notes.
- Spec File: Remove a workaround for ppc64le.
- Annocheck: Improve heuristic for skipping LTO and FORTIFY tests. (#2264000)
- Annocheck: Also skip property note test for i686 binaries. (#2258571)
- Annocheck: Also skip the entry point test for i686 binaries. (#2258571)
- GCC Plugin: Do not use section groups with string format notes.
- Annocheck: Disable cf-protection test for i686 architecture. (#2258571)
- Spec File: Disable hard gcc check in order to allow builds with new version of gcc.
- Spec File: Do not install annocheck.1.gz when annocheck is disabled.
- Annocheck: Improve detection of FIPS compliant GO binaries.
- GCC Plugin: Fix recording of the -Wimplicit-int and -Wimplicit-function-declaration warnings. Add active checks for when they are deliberately disabled.
- Tests: Fix implicit-values test so that it will compile with gcc 14+.

View File

@ -0,0 +1,38 @@
# Generate OUTPUT_FORMAT line for .so files from the system linker output.
# Imported from glibc/Makerules.
/ld.*[ ]-E[BL]/b f
/collect.*[ ]-E[BL]/b f
/OUTPUT_FORMAT[^)]*$/{N
s/\n[ ]*/ /
}
t o
: o
s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/
t q
s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\1,\2,\3/
t s
s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/
t q
d
: s
s/"//g
G
s/\n//
s/^\([^,]*\),\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\2)/p
s/^\([^,]*\),\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\3)/p
s/^\([^,]*\),\([^,]*\),\([^,]*\)/OUTPUT_FORMAT(\1)/p
/,/s|^|*** BUG in libc/scripts/output-format.sed *** |p
q
: q
s/"//g
p
q
: f
s/^.*[ ]-E\([BL]\)[ ].*$/,\1/
t h
s/^.*[ ]-E\([BL]\)$/,\1/
t h
d
: h
h

View File

@ -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;

View File

@ -0,0 +1,38 @@
diff -rup binutils.orig/bfd/bpf-reloc.def binutils-2.41/bfd/bpf-reloc.def
--- binutils.orig/bfd/bpf-reloc.def 2023-10-30 10:41:59.114273359 +0000
+++ binutils-2.41/bfd/bpf-reloc.def 2023-10-30 11:09:41.316109162 +0000
@@ -72,3 +72,20 @@
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
true) /* pcrel_offset */
+
+ /* R_BPF_64_NODYLD32 is not used by GNU tools - but it is generated by LLVM.
+ We provide an entry here so that tools like strip can safely handle BPF
+ binaries generated by other tools. */
+ BPF_HOWTO (R_BPF_64_NODYLD32, /* type */
+ 0, /* rightshift */
+ 0, /* size */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bpf_elf_generic_reloc, /* special_function */
+ "R_BPF_64_NODYLD32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false) /* pcrel_offset */
diff -rup binutils.orig/include/elf/bpf.h binutils-2.41/include/elf/bpf.h
--- binutils.orig/include/elf/bpf.h 2023-10-30 10:41:59.332273599 +0000
+++ binutils-2.41/include/elf/bpf.h 2023-10-30 10:59:44.475368448 +0000
@@ -30,8 +30,8 @@ START_RELOC_NUMBERS (elf_bpf_reloc_type)
RELOC_NUMBER (R_BPF_64_64, 1)
RELOC_NUMBER (R_BPF_64_ABS64, 2)
RELOC_NUMBER (R_BPF_64_ABS32, 3)
-/* R_BPF_64_NODYLD32 is not used by GNU tools.
- * It is kept in this file to remind that the value is already taken. */
+/* R_BPF_64_NODYLD32 is not used by GNU tools - but it is generated by LLVM.
+ It is kept in this file to remind that the value is already taken. */
RELOC_NUMBER (R_BPF_64_NODYLD32, 4)
RELOC_NUMBER (R_BPF_64_32, 10)
END_RELOC_NUMBERS (R_BPF_max)

View File

@ -0,0 +1,662 @@
diff -rup binutils.orig/bfd/bfd-in2.h binutils-2.41/bfd/bfd-in2.h
--- binutils.orig/bfd/bfd-in2.h 2024-04-05 10:34:23.956241281 +0100
+++ binutils-2.41/bfd/bfd-in2.h 2024-04-05 10:59:44.555106927 +0100
@@ -3840,6 +3840,12 @@ instruction. */
BFD_RELOC_X86_64_CODE_4_GOTPCRELX,
BFD_RELOC_X86_64_CODE_4_GOTTPOFF,
BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC,
+ BFD_RELOC_X86_64_CODE_5_GOTPCRELX,
+ BFD_RELOC_X86_64_CODE_5_GOTTPOFF,
+ BFD_RELOC_X86_64_CODE_5_GOTPC32_TLSDESC,
+ BFD_RELOC_X86_64_CODE_6_GOTPCRELX,
+ BFD_RELOC_X86_64_CODE_6_GOTTPOFF,
+ BFD_RELOC_X86_64_CODE_6_GOTPC32_TLSDESC,
/* ns32k relocations */
BFD_RELOC_NS32K_IMM_8,
diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.41/bfd/elf64-x86-64.c
--- binutils.orig/bfd/elf64-x86-64.c 2024-04-05 10:34:23.956241281 +0100
+++ binutils-2.41/bfd/elf64-x86-64.c 2024-04-05 10:59:44.557106930 +0100
@@ -179,12 +179,30 @@ static reloc_howto_type x86_64_elf_howto
HOWTO(R_X86_64_CODE_4_GOTPC32_TLSDESC, 0, 4, 32, true, 0,
complain_overflow_bitfield, bfd_elf_generic_reloc,
"R_X86_64_CODE_4_GOTPC32_TLSDESC", false, 0, 0xffffffff, true),
+ HOWTO(R_X86_64_CODE_5_GOTPCRELX, 0, 4, 32, true, 0,
+ complain_overflow_signed, bfd_elf_generic_reloc,
+ "R_X86_64_CODE_5_GOTPCRELX", false, 0, 0xffffffff, true),
+ HOWTO(R_X86_64_CODE_5_GOTTPOFF, 0, 4, 32, true, 0,
+ complain_overflow_signed, bfd_elf_generic_reloc,
+ "R_X86_64_CODE_5_GOTTPOFF", false, 0, 0xffffffff, true),
+ HOWTO(R_X86_64_CODE_5_GOTPC32_TLSDESC, 0, 4, 32, true, 0,
+ complain_overflow_bitfield, bfd_elf_generic_reloc,
+ "R_X86_64_CODE_5_GOTPC32_TLSDESC", false, 0, 0xffffffff, true),
+ HOWTO(R_X86_64_CODE_6_GOTPCRELX, 0, 4, 32, true, 0,
+ complain_overflow_signed, bfd_elf_generic_reloc,
+ "R_X86_64_CODE_6_GOTPCRELX", false, 0, 0xffffffff, true),
+ HOWTO(R_X86_64_CODE_6_GOTTPOFF, 0, 4, 32, true, 0,
+ complain_overflow_signed, bfd_elf_generic_reloc,
+ "R_X86_64_CODE_6_GOTTPOFF", false, 0, 0xffffffff, true),
+ HOWTO(R_X86_64_CODE_6_GOTPC32_TLSDESC, 0, 4, 32, true, 0,
+ complain_overflow_bitfield, bfd_elf_generic_reloc,
+ "R_X86_64_CODE_6_GOTPC32_TLSDESC", false, 0, 0xffffffff, true),
/* We have a gap in the reloc numbers here.
R_X86_64_standard counts the number up to this point, and
R_X86_64_vt_offset is the value to subtract from a reloc type of
R_X86_64_GNU_VT* to form an index into this table. */
-#define R_X86_64_standard (R_X86_64_CODE_4_GOTPC32_TLSDESC + 1)
+#define R_X86_64_standard (R_X86_64_CODE_6_GOTPC32_TLSDESC + 1)
#define R_X86_64_vt_offset (R_X86_64_GNU_VTINHERIT - R_X86_64_standard)
/* GNU extension to record C++ vtable hierarchy. */
@@ -256,6 +274,12 @@ static const struct elf_reloc_map x86_64
{ BFD_RELOC_X86_64_CODE_4_GOTPCRELX, R_X86_64_CODE_4_GOTPCRELX, },
{ BFD_RELOC_X86_64_CODE_4_GOTTPOFF, R_X86_64_CODE_4_GOTTPOFF, },
{ BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC, R_X86_64_CODE_4_GOTPC32_TLSDESC, },
+ { BFD_RELOC_X86_64_CODE_5_GOTPCRELX, R_X86_64_CODE_5_GOTPCRELX, },
+ { BFD_RELOC_X86_64_CODE_5_GOTTPOFF, R_X86_64_CODE_5_GOTTPOFF, },
+ { BFD_RELOC_X86_64_CODE_5_GOTPC32_TLSDESC, R_X86_64_CODE_5_GOTPC32_TLSDESC, },
+ { BFD_RELOC_X86_64_CODE_6_GOTPCRELX, R_X86_64_CODE_6_GOTPCRELX, },
+ { BFD_RELOC_X86_64_CODE_6_GOTTPOFF, R_X86_64_CODE_6_GOTTPOFF, },
+ { BFD_RELOC_X86_64_CODE_6_GOTPC32_TLSDESC, R_X86_64_CODE_6_GOTPC32_TLSDESC, },
{ BFD_RELOC_VTABLE_INHERIT, R_X86_64_GNU_VTINHERIT, },
{ BFD_RELOC_VTABLE_ENTRY, R_X86_64_GNU_VTENTRY, },
};
@@ -1283,6 +1307,23 @@ elf_x86_64_check_tls_transition (bfd *ab
goto check_gottpoff;
+ case R_X86_64_CODE_6_GOTTPOFF:
+ /* Check transition from IE access model:
+ add %reg1, foo@gottpoff(%rip), %reg2
+ where reg1/reg2 are one of r16 to r31. */
+
+ if (offset < 6
+ || (offset + 4) > sec->size
+ || contents[offset - 6] != 0x62)
+ return false;
+
+ val = bfd_get_8 (abfd, contents + offset - 2);
+ if (val != 0x01 && val != 0x03)
+ return false;
+
+ val = bfd_get_8 (abfd, contents + offset - 1);
+ return (val & 0xc7) == 5;
+
case R_X86_64_GOTTPOFF:
/* Check transition from IE access model:
mov foo@gottpoff(%rip), %reg
@@ -1417,6 +1458,7 @@ elf_x86_64_tls_transition (struct bfd_li
case R_X86_64_GOTTPOFF:
case R_X86_64_CODE_4_GOTPC32_TLSDESC:
case R_X86_64_CODE_4_GOTTPOFF:
+ case R_X86_64_CODE_6_GOTTPOFF:
if (bfd_link_executable (info))
{
if (h == NULL)
@@ -1464,6 +1506,8 @@ elf_x86_64_tls_transition (struct bfd_li
/* Return TRUE if there is no transition. */
if (from_type == to_type
|| (from_type == R_X86_64_CODE_4_GOTTPOFF
+ && to_type == R_X86_64_GOTTPOFF)
+ || (from_type == R_X86_64_CODE_6_GOTTPOFF
&& to_type == R_X86_64_GOTTPOFF))
return true;
@@ -2177,6 +2221,7 @@ elf_x86_64_scan_relocs (bfd *abfd, struc
case R_X86_64_GOTTPOFF:
case R_X86_64_CODE_4_GOTTPOFF:
+ case R_X86_64_CODE_6_GOTTPOFF:
if (!bfd_link_executable (info))
info->flags |= DF_STATIC_TLS;
/* Fall through */
@@ -2214,6 +2259,7 @@ elf_x86_64_scan_relocs (bfd *abfd, struc
break;
case R_X86_64_GOTTPOFF:
case R_X86_64_CODE_4_GOTTPOFF:
+ case R_X86_64_CODE_6_GOTTPOFF:
tls_type = GOT_TLS_IE;
break;
case R_X86_64_GOTPC32_TLSDESC:
@@ -2503,6 +2549,26 @@ elf_x86_64_scan_relocs (bfd *abfd, struc
}
break;
+ case R_X86_64_CODE_5_GOTPCRELX:
+ case R_X86_64_CODE_5_GOTTPOFF:
+ case R_X86_64_CODE_5_GOTPC32_TLSDESC:
+ case R_X86_64_CODE_6_GOTPCRELX:
+ case R_X86_64_CODE_6_GOTPC32_TLSDESC:
+ {
+ /* These relocations are added only for completeness and
+ aren't be used. */
+ if (h)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (abfd, symtab_hdr, isym,
+ NULL);
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB: unsupported relocation %s against symbol `%s'"),
+ abfd, x86_64_elf_howto_table[r_type].name, name);
+ }
+ break;
+
/* This relocation describes the C++ object vtable hierarchy.
Reconstruct it for later use during GC. */
case R_X86_64_GNU_VTINHERIT:
@@ -3570,6 +3636,7 @@ elf_x86_64_relocate_section (bfd *output
case R_X86_64_TLSDESC_CALL:
case R_X86_64_GOTTPOFF:
case R_X86_64_CODE_4_GOTTPOFF:
+ case R_X86_64_CODE_6_GOTTPOFF:
tls_type = GOT_UNKNOWN;
if (h == NULL && local_got_offsets)
tls_type = elf_x86_local_got_tls_type (input_bfd) [r_symndx];
@@ -3915,6 +3982,50 @@ elf_x86_64_relocate_section (bfd *output
contents + roff - 2);
bfd_put_8 (output_bfd, 0xc0 | reg,
contents + roff - 1);
+ bfd_put_32 (output_bfd,
+ elf_x86_64_tpoff (info, relocation),
+ contents + roff);
+ continue;
+ }
+ else if (r_type == R_X86_64_CODE_6_GOTTPOFF)
+ {
+ /* IE->LE transition:
+ Originally it is
+ add %reg1, foo@gottpoff(%rip), %reg2
+ or
+ add foo@gottpoff(%rip), %reg1, %reg2
+ We change it into:
+ add $foo@tpoff, %reg1, %reg2
+ */
+ unsigned int reg, byte1;
+ unsigned int updated_byte1;
+
+ if (roff < 6)
+ goto corrupt_input;
+
+ /* Move the R bits to the B bits in EVEX payload
+ byte 1. */
+ byte1 = bfd_get_8 (input_bfd, contents + roff - 5);
+ updated_byte1 = byte1;
+
+ /* Set the R bits since they is inverted. */
+ updated_byte1 |= 1 << 7 | 1 << 4;
+
+ /* Update the B bits from the R bits. */
+ if ((byte1 & (1 << 7)) == 0)
+ updated_byte1 &= ~(1 << 5);
+ if ((byte1 & (1 << 4)) == 0)
+ updated_byte1 |= 1 << 3;
+
+ reg = bfd_get_8 (input_bfd, contents + roff - 1);
+ reg >>= 3;
+
+ bfd_put_8 (output_bfd, updated_byte1,
+ contents + roff - 5);
+ bfd_put_8 (output_bfd, 0x81,
+ contents + roff - 2);
+ bfd_put_8 (output_bfd, 0xc0 | reg,
+ contents + roff - 1);
bfd_put_32 (output_bfd,
elf_x86_64_tpoff (info, relocation),
contents + roff);
diff -rup binutils.orig/bfd/libbfd.h binutils-2.41/bfd/libbfd.h
--- binutils.orig/bfd/libbfd.h 2024-04-05 10:34:23.956241281 +0100
+++ binutils-2.41/bfd/libbfd.h 2024-04-05 10:59:44.559106933 +0100
@@ -1470,6 +1470,12 @@ static const char *const bfd_reloc_code_
"BFD_RELOC_X86_64_CODE_4_GOTPCRELX",
"BFD_RELOC_X86_64_CODE_4_GOTTPOFF",
"BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC",
+ "BFD_RELOC_X86_64_CODE_5_GOTPCRELX",
+ "BFD_RELOC_X86_64_CODE_5_GOTTPOFF",
+ "BFD_RELOC_X86_64_CODE_5_GOTPC32_TLSDESC",
+ "BFD_RELOC_X86_64_CODE_6_GOTPCRELX",
+ "BFD_RELOC_X86_64_CODE_6_GOTTPOFF",
+ "BFD_RELOC_X86_64_CODE_6_GOTPC32_TLSDESC",
"BFD_RELOC_NS32K_IMM_8",
"BFD_RELOC_NS32K_IMM_16",
"BFD_RELOC_NS32K_IMM_32",
diff -rup binutils.orig/bfd/reloc.c binutils-2.41/bfd/reloc.c
--- binutils.orig/bfd/reloc.c 2024-04-05 10:34:23.956241281 +0100
+++ binutils-2.41/bfd/reloc.c 2024-04-05 10:59:44.561106936 +0100
@@ -2487,6 +2487,18 @@ ENUMX
BFD_RELOC_X86_64_CODE_4_GOTTPOFF
ENUMX
BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC
+ENUMX
+ BFD_RELOC_X86_64_CODE_5_GOTPCRELX
+ENUMX
+ BFD_RELOC_X86_64_CODE_5_GOTTPOFF
+ENUMX
+ BFD_RELOC_X86_64_CODE_5_GOTPC32_TLSDESC
+ENUMX
+ BFD_RELOC_X86_64_CODE_6_GOTPCRELX
+ENUMX
+ BFD_RELOC_X86_64_CODE_6_GOTTPOFF
+ENUMX
+ BFD_RELOC_X86_64_CODE_6_GOTPC32_TLSDESC
ENUMDOC
x86-64/elf relocations
diff -rup binutils.orig/elfcpp/x86_64.h binutils-2.41/elfcpp/x86_64.h
--- binutils.orig/elfcpp/x86_64.h 2024-04-05 10:34:23.969241295 +0100
+++ binutils-2.41/elfcpp/x86_64.h 2024-04-05 10:59:44.561106936 +0100
@@ -110,6 +110,30 @@ enum
// descriptor in GOT if the
// instruction starts at 4 bytes
// before the relocation offset.
+ R_X86_64_CODE_5_GOTPCRELX = 46, // 32 bit signed PC relative offset to
+ // GOT if the instruction starts at 5
+ // bytes before the relocation offset,
+ // relaxable.
+ R_X86_64_CODE_5_GOTTPOFF = 47, // 32 bit signed PC relative offset to
+ // GOT entry for IE symbol if the
+ // instruction starts at 5 bytes before
+ // the relocation offset.
+ R_X86_64_CODE_5_GOTPC32_TLSDESC = 48, // 32-bit PC relative to TLS
+ // descriptor in GOT if the
+ // instruction starts at 5 bytes
+ // before the relocation offset.
+ R_X86_64_CODE_6_GOTPCRELX = 49, // 32 bit signed PC relative offset to
+ // GOT if the instruction starts at 6
+ // bytes before the relocation offset,
+ // relaxable.
+ R_X86_64_CODE_6_GOTTPOFF = 50, // 32 bit signed PC relative offset to
+ // GOT entry for IE symbol if the
+ // instruction starts at 6 bytes before
+ // the relocation offset.
+ R_X86_64_CODE_6_GOTPC32_TLSDESC = 51, // 32-bit PC relative to TLS
+ // descriptor in GOT if the
+ // instruction starts at 6 bytes
+ // before the relocation offset.
// GNU vtable garbage collection extensions.
R_X86_64_GNU_VTINHERIT = 250,
R_X86_64_GNU_VTENTRY = 251
diff -rup binutils.orig/gas/config/tc-i386.c binutils-2.41/gas/config/tc-i386.c
--- binutils.orig/gas/config/tc-i386.c 2024-04-05 10:34:23.973241300 +0100
+++ binutils-2.41/gas/config/tc-i386.c 2024-04-05 10:59:44.561106936 +0100
@@ -3640,6 +3640,7 @@ tc_i386_fix_adjustable (fixS *fixP)
|| fixP->fx_r_type == BFD_RELOC_X86_64_DTPOFF64
|| fixP->fx_r_type == BFD_RELOC_X86_64_GOTTPOFF
|| fixP->fx_r_type == BFD_RELOC_X86_64_CODE_4_GOTTPOFF
+ || fixP->fx_r_type == BFD_RELOC_X86_64_CODE_6_GOTTPOFF
|| fixP->fx_r_type == BFD_RELOC_X86_64_TPOFF32
|| fixP->fx_r_type == BFD_RELOC_X86_64_TPOFF64
|| fixP->fx_r_type == BFD_RELOC_X86_64_GOTOFF64
@@ -5671,10 +5672,19 @@ md_assemble (char *line)
for (j = i.imm_operands; j < i.operands; ++j)
switch (i.reloc[j])
{
+ case BFD_RELOC_X86_64_GOTTPOFF:
+ if (i.tm.mnem_off == MN_add
+ && i.tm.opcode_space == SPACE_EVEXMAP4
+ && i.mem_operands == 1
+ && i.base_reg
+ && i.base_reg->reg_num == RegIP
+ && i.tm.operand_types[0].bitfield.class == Reg
+ && i.tm.operand_types[2].bitfield.class == Reg)
+ /* Allow APX: add %reg1, foo@gottpoff(%rip), %reg2. */
+ break;
+ /* Fall through. */
case BFD_RELOC_386_TLS_GOTIE:
case BFD_RELOC_386_TLS_LE_32:
- case BFD_RELOC_X86_64_GOTTPOFF:
- case BFD_RELOC_X86_64_CODE_4_GOTTPOFF:
case BFD_RELOC_X86_64_TLSLD:
as_bad (_("TLS relocation cannot be used with `%s'"), insn_name (&i.tm));
return;
@@ -10889,6 +10899,7 @@ output_disp (fragS *insn_start_frag, off
case BFD_RELOC_X86_64_TLSLD:
case BFD_RELOC_X86_64_GOTTPOFF:
case BFD_RELOC_X86_64_CODE_4_GOTTPOFF:
+ case BFD_RELOC_X86_64_CODE_6_GOTTPOFF:
case BFD_RELOC_X86_64_GOTPC32_TLSDESC:
case BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC:
case BFD_RELOC_X86_64_TLSDESC_CALL:
@@ -10905,9 +10916,30 @@ output_disp (fragS *insn_start_frag, off
&& !i.prefix[ADDR_PREFIX])
fixP->fx_signed = 1;
- /* Set fx_tcbit3 for REX2 prefix. */
- if (is_apx_rex2_encoding ())
- fixP->fx_tcbit3 = 1;
+ if (reloc_type == BFD_RELOC_X86_64_GOTTPOFF
+ && i.tm.opcode_space == SPACE_EVEXMAP4)
+ {
+ /* Only "add %reg1, foo@gottpoff(%rip), %reg2" is
+ allowed in md_assemble. Set fx_tcbit2 for EVEX
+ prefix. */
+ fixP->fx_tcbit2 = 1;
+ continue;
+ }
+
+ if (i.base_reg && i.base_reg->reg_num == RegIP)
+ {
+ if (reloc_type == BFD_RELOC_X86_64_GOTPC32_TLSDESC)
+ {
+ /* Set fx_tcbit for REX2 prefix. */
+ if (is_apx_rex2_encoding ())
+ fixP->fx_tcbit = 1;
+ continue;
+ }
+ }
+ /* In 64-bit, i386_validate_fix updates only (%rip)
+ relocations. */
+ else if (object_64bit)
+ continue;
/* Check for "call/jmp *mem", "mov mem, %reg",
"test %reg, mem" and "binop mem, %reg" where binop
@@ -10932,10 +10964,22 @@ output_disp (fragS *insn_start_frag, off
{
if (object_64bit)
{
- fixP->fx_tcbit = i.rex != 0;
- if (i.base_reg
- && (i.base_reg->reg_num == RegIP))
- fixP->fx_tcbit2 = 1;
+ if (reloc_type == BFD_RELOC_X86_64_GOTTPOFF)
+ {
+ /* Set fx_tcbit for REX2 prefix. */
+ if (is_apx_rex2_encoding ())
+ fixP->fx_tcbit = 1;
+ }
+ else
+ {
+ /* Set fx_tcbit3 for REX2 prefix. */
+ if (is_apx_rex2_encoding ())
+ fixP->fx_tcbit3 = 1;
+ else if (i.rex)
+ fixP->fx_tcbit2 = 1;
+ else
+ fixP->fx_tcbit = 1;
+ }
}
else
fixP->fx_tcbit2 = 1;
@@ -14405,6 +14449,7 @@ md_apply_fix (fixS *fixP, valueT *valP,
case BFD_RELOC_X86_64_TLSLD:
case BFD_RELOC_X86_64_GOTTPOFF:
case BFD_RELOC_X86_64_CODE_4_GOTTPOFF:
+ case BFD_RELOC_X86_64_CODE_6_GOTTPOFF:
case BFD_RELOC_X86_64_GOTPC32_TLSDESC:
case BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC:
value = 0; /* Fully resolved at runtime. No addend. */
@@ -15980,13 +16025,27 @@ i386_validate_fix (fixS *fixp)
&& (!S_IS_DEFINED (fixp->fx_addsy)
|| S_IS_EXTERNAL (fixp->fx_addsy));
- if (fixp->fx_tcbit3)
+ /* BFD_RELOC_X86_64_GOTTPOFF:
+ 1. fx_tcbit -> BFD_RELOC_X86_64_CODE_4_GOTTPOFF
+ 2. fx_tcbit2 -> BFD_RELOC_X86_64_CODE_6_GOTTPOFF
+ BFD_RELOC_X86_64_GOTPC32_TLSDESC:
+ 1. fx_tcbit -> BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC
+ BFD_RELOC_32_PCREL:
+ 1. fx_tcbit -> BFD_RELOC_X86_64_GOTPCRELX
+ 2. fx_tcbit2 -> BFD_RELOC_X86_64_REX_GOTPCRELX
+ 3. fx_tcbit3 -> BFD_RELOC_X86_64_CODE_4_GOTPCRELX
+ 4. else -> BFD_RELOC_X86_64_GOTPCREL
+ */
+ if (fixp->fx_r_type == BFD_RELOC_X86_64_GOTTPOFF)
{
- if (fixp->fx_r_type == BFD_RELOC_X86_64_GOTTPOFF)
+ if (fixp->fx_tcbit)
fixp->fx_r_type = BFD_RELOC_X86_64_CODE_4_GOTTPOFF;
- else if (fixp->fx_r_type == BFD_RELOC_X86_64_GOTPC32_TLSDESC)
- fixp->fx_r_type = BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC;
+ else if (fixp->fx_tcbit2)
+ fixp->fx_r_type = BFD_RELOC_X86_64_CODE_6_GOTTPOFF;
}
+ else if (fixp->fx_r_type == BFD_RELOC_X86_64_GOTPC32_TLSDESC
+ && fixp->fx_tcbit)
+ fixp->fx_r_type = BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC;
#endif
if (fixp->fx_subsy)
@@ -15998,15 +16057,12 @@ i386_validate_fix (fixS *fixp)
if (!object_64bit)
abort ();
#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- if (fixp->fx_tcbit2)
- {
- if (fixp->fx_tcbit3)
- fixp->fx_r_type = BFD_RELOC_X86_64_CODE_4_GOTPCRELX;
- else
- fixp->fx_r_type = (fixp->fx_tcbit
- ? BFD_RELOC_X86_64_REX_GOTPCRELX
- : BFD_RELOC_X86_64_GOTPCRELX);
- }
+ if (fixp->fx_tcbit)
+ fixp->fx_r_type = BFD_RELOC_X86_64_GOTPCRELX;
+ else if (fixp->fx_tcbit2)
+ fixp->fx_r_type = BFD_RELOC_X86_64_REX_GOTPCRELX;
+ else if (fixp->fx_tcbit3)
+ fixp->fx_r_type = BFD_RELOC_X86_64_CODE_4_GOTPCRELX;
else
#endif
fixp->fx_r_type = BFD_RELOC_X86_64_GOTPCREL;
@@ -16132,6 +16188,7 @@ tc_gen_reloc (asection *section ATTRIBUT
case BFD_RELOC_X86_64_DTPOFF64:
case BFD_RELOC_X86_64_GOTTPOFF:
case BFD_RELOC_X86_64_CODE_4_GOTTPOFF:
+ case BFD_RELOC_X86_64_CODE_6_GOTTPOFF:
case BFD_RELOC_X86_64_TPOFF32:
case BFD_RELOC_X86_64_TPOFF64:
case BFD_RELOC_X86_64_GOTOFF64:
@@ -16276,6 +16333,7 @@ tc_gen_reloc (asection *section ATTRIBUT
case BFD_RELOC_X86_64_TLSLD:
case BFD_RELOC_X86_64_GOTTPOFF:
case BFD_RELOC_X86_64_CODE_4_GOTTPOFF:
+ case BFD_RELOC_X86_64_CODE_6_GOTTPOFF:
case BFD_RELOC_X86_64_GOTPC32_TLSDESC:
case BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC:
case BFD_RELOC_X86_64_TLSDESC_CALL:
diff -rup binutils.orig/gas/testsuite/gas/i386/x86-64-gottpoff.d binutils-2.41/gas/testsuite/gas/i386/x86-64-gottpoff.d
--- binutils.orig/gas/testsuite/gas/i386/x86-64-gottpoff.d 2024-04-05 10:34:24.078241418 +0100
+++ binutils-2.41/gas/testsuite/gas/i386/x86-64-gottpoff.d 2024-04-05 10:59:44.561106936 +0100
@@ -16,4 +16,8 @@ Disassembly of section .text:
+[a-f0-9]+: 48 8b 05 00 00 00 00 mov 0x0\(%rip\),%rax # 2c <_start\+0x2c> 28: R_X86_64_GOTTPOFF foo-0x4
+[a-f0-9]+: d5 48 03 05 00 00 00 00 add 0x0\(%rip\),%r16 # 34 <_start\+0x34> 30: R_X86_64_CODE_4_GOTTPOFF foo-0x4
+[a-f0-9]+: d5 48 8b 25 00 00 00 00 mov 0x0\(%rip\),%r20 # 3c <_start\+0x3c> 38: R_X86_64_CODE_4_GOTTPOFF foo-0x4
+ +[a-f0-9]+: 62 74 fc 10 01 05 00 00 00 00 add %r8,0x0\(%rip\),%r16 # 46 <_start\+0x46> 42: R_X86_64_CODE_6_GOTTPOFF foo-0x4
+ +[a-f0-9]+: 62 f4 9c 18 03 05 00 00 00 00 add 0x0\(%rip\),%rax,%r12 # 50 <_start\+0x50> 4c: R_X86_64_CODE_6_GOTTPOFF foo-0x4
+ +[a-f0-9]+: 62 74 fc 10 01 05 00 00 00 00 add %r8,0x0\(%rip\),%r16 # 5a <_start\+0x5a> 56: R_X86_64_CODE_6_GOTTPOFF foo-0x4
+ +[a-f0-9]+: 62 f4 9c 18 03 05 00 00 00 00 add 0x0\(%rip\),%rax,%r12 # 64 <_start\+0x64> 60: R_X86_64_CODE_6_GOTTPOFF foo-0x4
#pass
diff -rup binutils.orig/gas/testsuite/gas/i386/x86-64-gottpoff.s binutils-2.41/gas/testsuite/gas/i386/x86-64-gottpoff.s
--- binutils.orig/gas/testsuite/gas/i386/x86-64-gottpoff.s 2024-04-05 10:34:24.078241418 +0100
+++ binutils-2.41/gas/testsuite/gas/i386/x86-64-gottpoff.s 2024-04-05 10:59:44.561106936 +0100
@@ -13,3 +13,13 @@ _start:
addq r16, QWORD PTR [rip + foo@GOTTPOFF]
movq r20, QWORD PTR [rip + foo@GOTTPOFF]
+
+ .att_syntax prefix
+
+ addq %r8, foo@GOTTPOFF(%rip), %r16
+ addq foo@GOTTPOFF(%rip), %rax, %r12
+
+ .intel_syntax noprefix
+
+ addq r16, QWORD PTR [rip + foo@GOTTPOFF], r8
+ addq r12, rax, QWORD PTR [rip + foo@GOTTPOFF]
diff -rup binutils.orig/gold/x86_64.cc binutils-2.41/gold/x86_64.cc
--- binutils.orig/gold/x86_64.cc 2024-04-05 10:34:24.166241517 +0100
+++ binutils-2.41/gold/x86_64.cc 2024-04-05 10:59:44.563106939 +0100
@@ -2920,6 +2920,11 @@ Target_x86_64<size>::optimize_tls_reloc(
// Another Local-Dynamic reloc.
return tls::TLSOPT_TO_LE;
+ case elfcpp::R_X86_64_CODE_6_GOTTPOFF:
+ if (r_offset <= 6 || *(reloc_view - 6) != 0x62)
+ return tls::TLSOPT_NONE;
+ goto handle_gottpoff;
+
case elfcpp::R_X86_64_CODE_4_GOTTPOFF:
if (r_offset <= 4 || *(reloc_view - 4) != 0xd5)
return tls::TLSOPT_NONE;
@@ -2929,6 +2934,7 @@ Target_x86_64<size>::optimize_tls_reloc(
// from the GOT. If we know that we are linking against the
// local symbol, we can switch to Local-Exec, which links the
// thread offset into the instruction.
+handle_gottpoff:
if (is_final)
return tls::TLSOPT_TO_LE;
return tls::TLSOPT_NONE;
@@ -2997,6 +3003,7 @@ Target_x86_64<size>::Scan::get_reference
case elfcpp::R_X86_64_DTPOFF64:
case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
case elfcpp::R_X86_64_CODE_4_GOTTPOFF:
+ case elfcpp::R_X86_64_CODE_6_GOTTPOFF:
case elfcpp::R_X86_64_TPOFF32: // Local-exec
return Symbol::TLS_REF;
@@ -3362,6 +3369,7 @@ need_got:
// These are initial tls relocs, which are expected when linking
case elfcpp::R_X86_64_CODE_4_GOTPC32_TLSDESC:
case elfcpp::R_X86_64_CODE_4_GOTTPOFF:
+ case elfcpp::R_X86_64_CODE_6_GOTTPOFF:
{
section_size_type stype;
reloc_view = object->section_contents(data_shndx, &stype, true);
@@ -3464,6 +3472,7 @@ need_got:
case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
case elfcpp::R_X86_64_CODE_4_GOTTPOFF:
+ case elfcpp::R_X86_64_CODE_6_GOTTPOFF:
layout->set_has_static_tls();
if (optimized_type == tls::TLSOPT_NONE)
{
@@ -3902,6 +3911,7 @@ Target_x86_64<size>::Scan::global(Symbol
// These are initial tls relocs, which are expected for global()
case elfcpp::R_X86_64_CODE_4_GOTPC32_TLSDESC:
case elfcpp::R_X86_64_CODE_4_GOTTPOFF:
+ case elfcpp::R_X86_64_CODE_6_GOTTPOFF:
{
section_size_type stype;
reloc_view = object->section_contents(data_shndx, &stype, true);
@@ -3920,7 +3930,8 @@ Target_x86_64<size>::Scan::global(Symbol
// when building an executable.
const bool is_final = (gsym->final_value_is_known() ||
((r_type == elfcpp::R_X86_64_GOTTPOFF ||
- r_type == elfcpp::R_X86_64_CODE_4_GOTTPOFF) &&
+ r_type == elfcpp::R_X86_64_CODE_4_GOTTPOFF||
+ r_type == elfcpp::R_X86_64_CODE_6_GOTTPOFF) &&
gsym->is_undefined() &&
parameters->options().output_is_executable()));
size_t r_offset = reloc.get_r_offset();
@@ -4006,6 +4017,7 @@ Target_x86_64<size>::Scan::global(Symbol
case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
case elfcpp::R_X86_64_CODE_4_GOTTPOFF:
+ case elfcpp::R_X86_64_CODE_6_GOTTPOFF:
layout->set_has_static_tls();
if (optimized_type == tls::TLSOPT_NONE)
{
@@ -4608,6 +4620,7 @@ Target_x86_64<size>::Relocate::relocate(
case elfcpp::R_X86_64_DTPOFF64:
case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
case elfcpp::R_X86_64_CODE_4_GOTTPOFF:
+ case elfcpp::R_X86_64_CODE_6_GOTTPOFF:
case elfcpp::R_X86_64_TPOFF32: // Local-exec
this->relocate_tls(relinfo, target, relnum, rela, r_type, gsym, psymval,
view, address, view_size);
@@ -4894,6 +4907,7 @@ Target_x86_64<size>::Relocate::relocate_
case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
case elfcpp::R_X86_64_CODE_4_GOTTPOFF:
+ case elfcpp::R_X86_64_CODE_6_GOTTPOFF:
if (gsym != NULL
&& gsym->is_undefined()
&& parameters->options().output_is_executable())
@@ -5308,11 +5322,19 @@ Target_x86_64<size>::Relocate::tls_ie_to
// movq foo@gottpoff(%rip),%reg ==> movq $YY,%reg
// addq foo@gottpoff(%rip),%reg ==> addq $YY,%reg
+ // addq %reg1,foo@gottpoff(%rip),%reg2 ==> addq $YY,%reg1,%reg2
+ // addq foo@gottpoff(%rip),%reg1,%reg2 ==> addq $YY,%reg1,%reg2
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, -3);
+ int off1;
+ if (r_type == elfcpp::R_X86_64_CODE_6_GOTTPOFF)
+ off1 = -5;
+ else
+ off1 = -3;
+
+ tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, off1);
tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 4);
- unsigned char op1 = view[-3];
+ unsigned char op1 = view[off1];
unsigned char op2 = view[-2];
unsigned char op3 = view[-1];
unsigned char reg = op3 >> 3;
@@ -5350,7 +5372,7 @@ Target_x86_64<size>::Relocate::tls_ie_to
view[-1] = 0x80 | reg | (reg << 3);
}
}
- else
+ else if (r_type == elfcpp::R_X86_64_CODE_4_GOTTPOFF)
{
if (op2 == 0x8b)
op2 = 0xc7;
@@ -5362,6 +5384,23 @@ Target_x86_64<size>::Relocate::tls_ie_to
view[-2] = op2;
view[-1] = 0xc0 | reg;
}
+ else
+ {
+ unsigned char updated_op1 = op1;
+
+ // Set the R bits since they is inverted.
+ updated_op1 |= 1 << 7 | 1 << 4;
+
+ // Update the B bits from the R bits.
+ if ((op1 & (1 << 7)) == 0)
+ updated_op1 &= ~(1 << 5);
+ if ((op1 & (1 << 4)) == 0)
+ updated_op1 |= 1 << 3;
+
+ view[-5] = updated_op1;
+ view[-2] = 0x81;
+ view[-1] = 0xc0 | reg;
+ }
if (tls_segment != NULL)
value -= tls_segment->memsz();
diff -rup binutils.orig/include/elf/x86-64.h binutils-2.41/include/elf/x86-64.h
--- binutils.orig/include/elf/x86-64.h 2024-04-05 10:34:24.174241526 +0100
+++ binutils-2.41/include/elf/x86-64.h 2024-04-05 10:59:44.563106939 +0100
@@ -92,6 +92,26 @@ START_RELOC_NUMBERS (elf_x86_64_reloc_ty
/* 32 bit signed pc relative offset to TLS descriptor in the GOT if
instruction starts at 4 bytes before the relocation offset. */
RELOC_NUMBER (R_X86_64_CODE_4_GOTPC32_TLSDESC, 45)
+ /* Load from 32 bit signed pc relative offset to GOT entry if the
+ instruction starts at 5 bytes before the relocation offset,
+ relaxable. */
+ RELOC_NUMBER (R_X86_64_CODE_5_GOTPCRELX, 46)
+ /* 32 bit signed pc relative offset to TLS descriptor in the GOT if
+ instruction starts at 5 bytes before the relocation offset. */
+ RELOC_NUMBER (R_X86_64_CODE_5_GOTPC32_TLSDESC, 47)
+ /* PC relative offset to IE GOT entry if the instruction starts at
+ 5 bytes before the relocation offset. */
+ RELOC_NUMBER (R_X86_64_CODE_5_GOTTPOFF, 48)
+ /* Load from 32 bit signed pc relative offset to GOT entry if the
+ instruction starts at 6 bytes before the relocation offset,
+ relaxable. */
+ RELOC_NUMBER (R_X86_64_CODE_6_GOTPCRELX, 49)
+ /* PC relative offset to IE GOT entry if the instruction starts at
+ 6 bytes before the relocation offset. */
+ RELOC_NUMBER (R_X86_64_CODE_6_GOTTPOFF, 50)
+ /* 32 bit signed pc relative offset to TLS descriptor in the GOT if
+ instruction starts at 6 bytes before the relocation offset. */
+ RELOC_NUMBER (R_X86_64_CODE_6_GOTPC32_TLSDESC, 51)
RELOC_NUMBER (R_X86_64_GNU_VTINHERIT, 250) /* GNU C++ hack */
RELOC_NUMBER (R_X86_64_GNU_VTENTRY, 251) /* GNU C++ hack */
END_RELOC_NUMBERS (R_X86_64_max)

View File

@ -0,0 +1,871 @@
diff -rupN binutils.orig/opcodes/i386-dis.c binutils-2.41/opcodes/i386-dis.c
--- binutils.orig/opcodes/i386-dis.c 2024-02-12 15:55:21.578572835 +0000
+++ binutils-2.41/opcodes/i386-dis.c 2024-02-12 15:56:38.828623964 +0000
@@ -8824,6 +8824,8 @@ get_valid_dis386 (const struct dis386 *d
break;
case USE_3BYTE_TABLE:
+ if (ins->last_rex2_prefix >= 0)
+ return &err_opcode;
if (!fetch_code (ins->info, ins->codep + 2))
return &err_opcode;
vindex = *ins->codep++;
@@ -9540,8 +9542,6 @@ print_insn (bfd_vma pc, disassemble_info
/* REX2.M in rex2 prefix represents map0 or map1. */
if (ins.last_rex2_prefix < 0 ? *ins.codep == 0x0f : (ins.rex2 & REX2_M))
{
- unsigned char threebyte;
-
if (!ins.rex2)
{
ins.codep++;
@@ -9549,17 +9549,15 @@ print_insn (bfd_vma pc, disassemble_info
goto fetch_error_out;
}
- threebyte = *ins.codep;
- dp = &dis386_twobyte[threebyte];
- ins.need_modrm = twobyte_has_modrm[threebyte];
- ins.codep++;
+ dp = &dis386_twobyte[*ins.codep];
+ ins.need_modrm = twobyte_has_modrm[*ins.codep];
}
else
{
dp = &dis386[*ins.codep];
ins.need_modrm = onebyte_has_modrm[*ins.codep];
- ins.codep++;
}
+ ins.codep++;
/* Save sizeflag for printing the extra ins.prefixes later before updating
it for mnemonic and operand processing. The prefix names depend
diff -rupN binutils.orig/opcodes/i386-opc.tbl binutils-2.41/opcodes/i386-opc.tbl
--- binutils.orig/opcodes/i386-opc.tbl 2024-02-12 15:55:21.578572835 +0000
+++ binutils-2.41/opcodes/i386-opc.tbl 2024-02-12 15:56:28.955616704 +0000
@@ -1586,7 +1586,9 @@ vandnp<sd>, 0x<sd:ppfx>55, AVX, Modrm|Ve
vandp<sd>, 0x<sd:ppfx>54, AVX, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM }
vblendp<sd>, 0x660c | <sd:opc>, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM }
vblendvp<sd>, 0x664a | <sd:opc>, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexW0|CheckOperandSize|NoSuf, { RegXMM|RegYMM, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM }
-vbroadcastf128, 0x661a, AVX, Modrm|Vex=2|Space0F38|VexW=1|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM }
+vbroadcastf128, 0x661a, AVX, Modrm|Vex256|Space0F38|VexW0|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM }
+// vbroadcastf32x4 in disguise (see vround{p,s}{s,d} comment)
+vbroadcastf128, 0x661a, APX_F&AVX512VL, Modrm|EVex256|Space0F38|VexW0|Disp8MemShift=4|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM }
vbroadcastsd, 0x6619, AVX, Modrm|Vex256|Space0F38|VexW0|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM }
vbroadcastss, 0x6618, AVX, Modrm|Vex128|Space0F38|VexW0|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM|RegYMM }
vcmp<frel>p<sd>, 0x<sd:ppfx>c2/0x<frel:imm>, AVX, Modrm|<frel:comm>|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|Unspecified|BaseIndex, RegXMM|RegYMM, RegXMM|RegYMM }
@@ -1614,7 +1616,9 @@ vdivp<sd>, 0x<sd:ppfx>5e, AVX, Modrm|Vex
vdivs<sd>, 0x<sd:spfx>5e, AVX, Modrm|VexLIG|Space0F|VexVVVV|VexWIG|NoSuf, { <sd:elem>|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
vdppd, 0x6641, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
vdpps, 0x6640, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM }
-vextractf128, 0x6619, AVX, Modrm|Vex=2|Space0F3A|VexW=1|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM }
+vextractf128, 0x6619, AVX, Modrm|Vex256|Space0F3A|VexW0|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM }
+// vextractf32x4 in disguise (see vround{p,s}{s,d} comment)
+vextractf128, 0x6619, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexW0|Disp8MemShift=4|NoSuf, { Imm8, RegYMM, Xmmword|Unspecified|BaseIndex }
vextractps, 0x6617, AVX|AVX512F, Modrm|Vex128|EVex128|Space0F3A|VexWIG|Disp8MemShift=2|NoSuf, { Imm8, RegXMM, Reg32|Unspecified|BaseIndex }
vextractps, 0x6617, x64&(AVX|AVX512F), RegMem|Vex128|EVex128|Space0F3A|VexWIG|NoSuf, { Imm8, RegXMM, Reg64 }
vhaddpd, 0x667c, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM }
@@ -1622,6 +1626,8 @@ vhaddps, 0xf27c, AVX, Modrm|Vex|Space0F|
vhsubpd, 0x667d, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM }
vhsubps, 0xf27d, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM }
vinsertf128, 0x6618, AVX, Modrm|Vex256|Space0F3A|VexVVVV|VexW0|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegYMM, RegYMM }
+// vinsertf32x4 in disguise (see vround{p,s}{s,d} comment)
+vinsertf128, 0x6618, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|NoSuf, { Imm8, Xmmword|Unspecified|BaseIndex, RegYMM, RegYMM }
vinsertps, 0x6621, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, Dword|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
vlddqu, 0xf2f0, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM }
vldmxcsr, 0xae/2, AVX, Modrm|Vex128|Space0F|VexWIG|NoSuf, { Dword|Unspecified|BaseIndex }
@@ -1792,8 +1798,8 @@ vroundp<sd>, 0x6608 | <sd:opc>, AVX, Mod
vrounds<sd>, 0x660a | <sd:opc>, AVX, Modrm|VexLIG|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, <sd:elem>|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
// These are really clones of VRNDSCALE{P,S}{S,D}, with broadcast, masking, SAE,
// 512-bit operand size, and register sources dropped.
-vroundp<sd>, 0x6608 | <sd:opc>, APX_F, Modrm|Space0F3A|<sd:vexw>|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM }
-vrounds<sd>, 0x660a | <sd:opc>, APX_F, Modrm|EVexLIG|Space0F3A|VexVVVV|<sd:vexw>|Disp8MemShift|NoSuf, { Imm8, <sd:elem>|Unspecified|BaseIndex, RegXMM, RegXMM }
+vroundp<sd>, 0x6608 | <sd:opc>, APX_F&AVX512VL, Modrm|Space0F3A|<sd:vexw>|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM }
+vrounds<sd>, 0x660a | <sd:opc>, APX_F&AVX512F, Modrm|EVexLIG|Space0F3A|VexVVVV|<sd:vexw>|Disp8MemShift|NoSuf, { Imm8, <sd:elem>|Unspecified|BaseIndex, RegXMM, RegXMM }
vrsqrtps, 0x52, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM }
vrsqrtss, 0xf352, AVX, Modrm|Vex=3|Space0F|VexVVVV|VexWIG|NoSuf, { Dword|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
vshufp<sd>, 0x<sd:ppfx>c6, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM }
@@ -1828,7 +1834,9 @@ vpmovzxwq, 0x6634, AVX2|AVX512VL, Modrm|
// New AVX2 instructions.
-vbroadcasti128, 0x665A, AVX2, Modrm|Vex=2|Space0F38|VexW=1|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM }
+vbroadcasti128, 0x665A, AVX2, Modrm|Vex256|Space0F38|VexW0|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM }
+// vbroadcasti32x4 in disguise (see vround{p,s}{s,d} comment)
+vbroadcasti128, 0x665a, APX_F&AVX512VL, Modrm|EVex256|Space0F38|VexW0|Disp8MemShift=4|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM }
vbroadcastsd, 0x6619, AVX2, Modrm|Vex=2|Space0F38|VexW=1|NoSuf, { RegXMM, RegYMM }
vbroadcastss, 0x6618, AVX2|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM }
vpblendd, 0x6602, AVX2, Modrm|Vex|Space0F3A|VexVVVV|VexW0|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM }
@@ -1840,8 +1848,12 @@ vpermd, 0x6636, AVX2|AVX512F, Modrm|Vex2
vpermpd, 0x6601, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F3A|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegYMM|RegZMM }
vpermps, 0x6616, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F38|VexVVVV|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM }
vpermq, 0x6600, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F3A|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegYMM|RegZMM }
-vextracti128, 0x6639, AVX2, Modrm|Vex=2|Space0F3A|VexW=1|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM }
+vextracti128, 0x6639, AVX2, Modrm|Vex256|Space0F3A|VexW0|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM }
+// vextracti32x4 in disguise (see vround{p,s}{s,d} comment)
+vextracti128, 0x6639, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexW0|Disp8MemShift=4|NoSuf, { Imm8, RegYMM, Xmmword|Unspecified|BaseIndex }
vinserti128, 0x6638, AVX2, Modrm|Vex256|Space0F3A|VexVVVV|VexW0|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegYMM, RegYMM }
+// vinserti32x4 in disguise (see vround{p,s}{s,d} comment)
+vinserti128, 0x6638, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|NoSuf, { Imm8, Xmmword|Unspecified|BaseIndex, RegYMM, RegYMM }
vpmaskmov<dq>, 0x668e, AVX2, Modrm|Vex|Space0F38|VexVVVV|<dq:vexw>|CheckOperandSize|NoSuf, { RegXMM|RegYMM, RegXMM|RegYMM, Xmmword|Ymmword|Unspecified|BaseIndex }
vpmaskmov<dq>, 0x668c, AVX2, Modrm|Vex|Space0F38|VexVVVV|<dq:vexw>|CheckOperandSize|NoSuf, { Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM, RegXMM|RegYMM }
vpsllv<dq>, 0x6647, AVX2|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F38|VexVVVV|<dq:vexw>|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|<dq:elem>|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM }
@@ -2115,12 +2127,12 @@ xcryptofb, 0xf30fa7e8, PadLock, NoSuf|Re
xstore, 0xfa7c0, PadLock, NoSuf|RepPrefixOk, {}
// Multy-precision Add Carry, rdseed instructions.
-adcx, 0x6666, ADX&APX_F, C|Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|DstVVVV|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 }
+adcx, 0x6666, ADX&APX_F, C|Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|DstVVVV|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 }
adcx, 0x660f38f6, ADX, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 }
-adcx, 0x6666, ADX&APX_F, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 }
-adox, 0xf366, ADX&APX_F, C|Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|DstVVVV|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 }
+adcx, 0x6666, ADX&APX_F, Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 }
+adox, 0xf366, ADX&APX_F, C|Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|DstVVVV|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 }
adox, 0xf30f38f6, ADX, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 }
-adox, 0xf366, ADX&APX_F, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 }
+adox, 0xf366, ADX&APX_F, Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 }
rdseed, 0xfc7/7, RdSeed, Modrm|NoSuf, { Reg16|Reg32|Reg64 }
// SMAP instructions.
@@ -3098,11 +3110,11 @@ rdsspq, 0xf30f1e/1, SHSTK&x64, Modrm|NoS
saveprevssp, 0xf30f01ea, SHSTK, NoSuf, {}
rstorssp, 0xf30f01/5, SHSTK, Modrm|NoSuf, { Qword|Unspecified|BaseIndex }
wrssd, 0x0f38f6, SHSTK, Modrm|IgnoreSize|NoSuf, { Reg32, Dword|Unspecified|BaseIndex }
-wrssd, 0x66, SHSTK&APX_F, Modrm|IgnoreSize|NoSuf|EVexMap4, { Reg32, Dword|Unspecified|BaseIndex }
+wrssd, 0x66, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg32, Dword|Unspecified|BaseIndex }
wrssq, 0x0f38f6, SHSTK&x64, Modrm|NoSuf|Size64, { Reg64, Qword|Unspecified|BaseIndex }
wrssq, 0x66, SHSTK&APX_F, Modrm|NoSuf|Size64|EVexMap4, { Reg64, Qword|Unspecified|BaseIndex }
wrussd, 0x660f38f5, SHSTK, Modrm|IgnoreSize|NoSuf, { Reg32, Dword|Unspecified|BaseIndex }
-wrussd, 0x6665, SHSTK&APX_F, Modrm|IgnoreSize|NoSuf|EVexMap4, { Reg32, Dword|Unspecified|BaseIndex }
+wrussd, 0x6665, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg32, Dword|Unspecified|BaseIndex }
wrussq, 0x660f38f5, SHSTK&x64, Modrm|NoSuf, { Reg64, Qword|Unspecified|BaseIndex }
wrussq, 0x6665, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg64, Qword|Unspecified|BaseIndex }
setssbsy, 0xf30f01e8, SHSTK, NoSuf, {}
@@ -3152,7 +3164,7 @@ cldemote, 0x0f1c/0, CLDEMOTE, Modrm|Anys
// MOVDIR[I,64B] instructions.
movdiri, 0xf38f9, MOVDIRI, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
-movdiri, 0xf9, MOVDIRI&APX_F, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
+movdiri, 0xf9, MOVDIRI&APX_F, Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
movdir64b, 0x660f38f8, MOVDIR64B, Modrm|AddrPrefixOpReg|NoSuf, { Unspecified|BaseIndex, Reg16|Reg32|Reg64 }
movdir64b, 0x66f8, MOVDIR64B&APX_F, Modrm|AddrPrefixOpReg|NoSuf|EVexMap4, { Unspecified|BaseIndex, Reg32|Reg64 }
@@ -3459,13 +3471,13 @@ wrmsrlist, 0xf30f01c6, MSRLIST, NoSuf, {
// RAO-INT instructions.
aadd, 0xf38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
-aadd, 0xfc, RAO_INT&APX_F, Modrm|IgnoreSize|CheckOperandSize|NoSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
+aadd, 0xfc, RAO_INT&APX_F, Modrm|CheckOperandSize|NoSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
aand, 0x660f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
-aand, 0x66fc, RAO_INT&APX_F, Modrm|IgnoreSize|CheckOperandSize|NoSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
+aand, 0x66fc, RAO_INT&APX_F, Modrm|CheckOperandSize|NoSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
aor, 0xf20f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
-aor, 0xf2fc, RAO_INT&APX_F, Modrm|IgnoreSize|CheckOperandSize|NoSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
+aor, 0xf2fc, RAO_INT&APX_F, Modrm|CheckOperandSize|NoSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
axor, 0xf30f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
-axor, 0xf3fc, RAO_INT&APX_F, Modrm|IgnoreSize|CheckOperandSize|NoSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
+axor, 0xf3fc, RAO_INT&APX_F, Modrm|CheckOperandSize|NoSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex }
// RAO-INT instructions end.
diff -rupN binutils.orig/opcodes/i386-tbl.h binutils-2.41/opcodes/i386-tbl.h
--- binutils.orig/opcodes/i386-tbl.h 2024-02-12 15:55:21.578572835 +0000
+++ binutils-2.41/opcodes/i386-tbl.h 2024-02-12 16:42:52.494835094 +0000
@@ -15372,6 +15372,16 @@ static const insn_template i386_optab[]
1, 0, 0, 0, 1, 0 } },
{ { 7, 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 } } } },
+ { MN_vbroadcastf128, 0x1a, 2, SPACE_0F38, None,
+ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
+ 0 },
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 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, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0 } },
+ { { 7, 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 } } } },
{ MN_vbroadcastsd, 0x19, 2, SPACE_0F38, None,
{ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
@@ -20804,6 +20814,18 @@ static const insn_template i386_optab[]
0, 1, 0, 0, 0, 0 } },
{ { 7, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0 } } } },
+ { MN_vextractf128, 0x19, 3, SPACE_0F3A, None,
+ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
+ 0 },
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0 } },
+ { { 7, 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, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0 } } } },
{ MN_vextractps, 0x17, 3, SPACE_0F3A, None,
{ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 3, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
@@ -20890,6 +20912,20 @@ static const insn_template i386_optab[]
0, 1, 0, 0, 0, 0 } },
{ { 7, 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 } } } },
+ { MN_vinsertf128, 0x18, 4, SPACE_0F3A, None,
+ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
+ 0 },
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0 } },
+ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0 } },
+ { { 7, 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 } },
+ { { 7, 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 } } } },
{ MN_vinsertps, 0x21, 4, SPACE_0F3A, None,
{ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
@@ -25296,7 +25332,7 @@ static const insn_template i386_optab[]
{ 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 1, 0, 0, 5, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0,
0 },
- { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0 } },
@@ -25320,7 +25356,7 @@ static const insn_template i386_optab[]
{ 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 1, 0, 0, 5, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0,
0 },
- { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0 } },
@@ -25346,7 +25382,7 @@ static const insn_template i386_optab[]
{ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1, 1, 0, 0, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
0 },
- { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0 } },
@@ -25374,7 +25410,7 @@ static const insn_template i386_optab[]
{ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 2, 1, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
0 },
- { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0 } },
@@ -25884,6 +25920,16 @@ static const insn_template i386_optab[]
1, 0, 0, 0, 1, 0 } },
{ { 7, 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 } } } },
+ { MN_vbroadcasti128, 0x5a, 2, SPACE_0F38, None,
+ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
+ 0 },
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 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, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0 } },
+ { { 7, 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 } } } },
{ MN_vpblendd, 0x02, 4, SPACE_0F3A, None,
{ 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
@@ -26106,6 +26152,18 @@ static const insn_template i386_optab[]
0, 1, 0, 0, 0, 0 } },
{ { 7, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0 } } } },
+ { MN_vextracti128, 0x39, 3, SPACE_0F3A, None,
+ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
+ 0 },
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0 } },
+ { { 7, 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, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0 } } } },
{ MN_vinserti128, 0x38, 4, SPACE_0F3A, None,
{ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
@@ -26120,6 +26178,20 @@ static const insn_template i386_optab[]
0, 1, 0, 0, 0, 0 } },
{ { 7, 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 } } } },
+ { MN_vinserti128, 0x38, 4, SPACE_0F3A, None,
+ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
+ 0 },
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0 } },
+ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0 } },
+ { { 7, 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 } },
+ { { 7, 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 } } } },
{ MN_vpmaskmovd, 0x8e, 3, SPACE_0F38, None,
{ 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
@@ -30933,7 +31005,7 @@ static const insn_template i386_optab[]
{ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0 } } } },
{ MN_adcx, 0x66, 3, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 61, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -30955,7 +31027,7 @@ static const insn_template i386_optab[]
{ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0 } } } },
{ MN_adcx, 0x66, 2, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 61, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -30965,7 +31037,7 @@ static const insn_template i386_optab[]
{ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0 } } } },
{ MN_adox, 0x66, 3, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 2, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 61, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -30987,7 +31059,7 @@ static const insn_template i386_optab[]
{ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0 } } } },
{ MN_adox, 0x66, 2, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 61, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -37497,7 +37569,7 @@ static const insn_template i386_optab[]
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0 } } } },
{ MN_wrssd, 0x66, 2, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 105, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -37537,7 +37609,7 @@ static const insn_template i386_optab[]
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0 } } } },
{ MN_wrussd, 0x65, 2, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 105, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -37697,7 +37769,7 @@ static const insn_template i386_optab[]
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 1, 0 } } } },
{ MN_movdiri, 0xf9, 2, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 120, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -41093,7 +41165,7 @@ static const insn_template i386_optab[]
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 1, 0 } } } },
{ MN_aadd, 0xfc, 2, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 95, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -41113,7 +41185,7 @@ static const insn_template i386_optab[]
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 1, 0 } } } },
{ MN_aand, 0xfc, 2, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 95, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -41133,7 +41205,7 @@ static const insn_template i386_optab[]
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 1, 0 } } } },
{ MN_aor, 0xfc, 2, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 95, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -41153,7 +41225,7 @@ static const insn_template i386_optab[]
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 1, 0 } } } },
{ MN_axor, 0xfc, 2, SPACE_EVEXMAP4, None,
- { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0 },
{ { 95, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } },
@@ -41398,203 +41470,203 @@ static const i386_op_off_t i386_op_sets[
1540, 1541, 1542, 1544, 1546, 1548, 1550, 1552,
1554, 1556, 1558, 1560, 1562, 1564, 1566, 1568,
1570, 1572, 1574, 1576, 1578, 1579, 1580, 1582,
- 1584, 1586, 1588, 1589, 1590, 1591, 1592, 1593,
- 1596, 1598, 1600, 1602, 1604, 1606, 1608, 1610,
- 1612, 1614, 1616, 1618, 1620, 1622, 1624, 1626,
- 1628, 1630, 1632, 1634, 1636, 1638, 1640, 1642,
- 1644, 1646, 1648, 1650, 1652, 1654, 1656, 1658,
- 1660, 1662, 1664, 1666, 1668, 1670, 1672, 1674,
- 1676, 1678, 1680, 1682, 1684, 1686, 1688, 1690,
- 1692, 1694, 1696, 1698, 1700, 1702, 1704, 1706,
- 1708, 1710, 1712, 1714, 1716, 1718, 1720, 1722,
- 1724, 1726, 1728, 1730, 1732, 1734, 1736, 1738,
- 1740, 1742, 1744, 1746, 1748, 1750, 1752, 1754,
- 1756, 1758, 1760, 1762, 1764, 1766, 1768, 1770,
- 1772, 1774, 1776, 1778, 1780, 1782, 1784, 1786,
- 1788, 1790, 1792, 1794, 1796, 1798, 1800, 1802,
- 1804, 1806, 1808, 1810, 1812, 1814, 1816, 1818,
- 1820, 1822, 1824, 1826, 1828, 1830, 1832, 1834,
- 1836, 1838, 1840, 1842, 1844, 1846, 1848, 1850,
- 1852, 1854, 1856, 1858, 1860, 1862, 1864, 1866,
- 1868, 1870, 1872, 1874, 1876, 1878, 1880, 1882,
- 1884, 1886, 1888, 1890, 1892, 1894, 1896, 1898,
- 1900, 1902, 1904, 1906, 1908, 1910, 1912, 1914,
- 1916, 1918, 1920, 1922, 1924, 1926, 1928, 1930,
- 1932, 1934, 1936, 1938, 1940, 1942, 1944, 1946,
- 1948, 1950, 1952, 1954, 1956, 1958, 1960, 1962,
- 1964, 1966, 1968, 1970, 1972, 1974, 1976, 1978,
- 1983, 1985, 1990, 1992, 1994, 1999, 2001, 2003,
- 2005, 2010, 2012, 2014, 2016, 2020, 2026, 2028,
- 2033, 2035, 2037, 2039, 2041, 2043, 2045, 2047,
- 2049, 2051, 2052, 2053, 2054, 2056, 2057, 2058,
- 2059, 2060, 2061, 2063, 2064, 2065, 2066, 2068,
- 2070, 2072, 2074, 2076, 2078, 2080, 2082, 2084,
- 2086, 2088, 2090, 2092, 2096, 2097, 2098, 2100,
- 2104, 2108, 2110, 2114, 2118, 2119, 2120, 2122,
- 2124, 2126, 2128, 2133, 2137, 2141, 2143, 2145,
- 2147, 2149, 2150, 2152, 2154, 2156, 2158, 2160,
- 2162, 2164, 2166, 2168, 2170, 2172, 2174, 2176,
- 2178, 2180, 2182, 2184, 2186, 2188, 2190, 2192,
- 2194, 2195, 2196, 2198, 2200, 2201, 2202, 2205,
- 2208, 2211, 2214, 2216, 2218, 2220, 2222, 2224,
- 2226, 2227, 2228, 2229, 2231, 2235, 2237, 2239,
- 2245, 2249, 2250, 2251, 2252, 2253, 2254, 2255,
- 2256, 2260, 2262, 2264, 2268, 2270, 2272, 2274,
- 2276, 2278, 2280, 2282, 2284, 2286, 2288, 2290,
- 2292, 2294, 2296, 2297, 2300, 2303, 2308, 2313,
- 2316, 2319, 2322, 2325, 2330, 2335, 2338, 2341,
- 2343, 2345, 2347, 2349, 2351, 2353, 2355, 2356,
- 2358, 2360, 2362, 2364, 2366, 2367, 2368, 2369,
- 2373, 2377, 2379, 2383, 2387, 2391, 2395, 2399,
- 2401, 2405, 2407, 2409, 2411, 2413, 2415, 2417,
- 2419, 2421, 2422, 2424, 2426, 2428, 2430, 2432,
- 2434, 2436, 2438, 2439, 2440, 2441, 2443, 2445,
- 2447, 2449, 2450, 2451, 2453, 2455, 2457, 2459,
- 2461, 2463, 2464, 2466, 2468, 2470, 2472, 2473,
- 2474, 2476, 2478, 2480, 2482, 2484, 2486, 2488,
- 2490, 2491, 2492, 2493, 2494, 2497, 2500, 2502,
- 2505, 2506, 2507, 2509, 2510, 2512, 2513, 2514,
- 2516, 2518, 2519, 2520, 2521, 2522, 2523, 2526,
- 2531, 2536, 2541, 2546, 2549, 2554, 2559, 2561,
- 2563, 2565, 2567, 2568, 2569, 2571, 2573, 2575,
- 2577, 2579, 2581, 2583, 2584, 2585, 2586, 2587,
- 2588, 2589, 2594, 2599, 2600, 2601, 2602, 2603,
- 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611,
- 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619,
- 2620, 2621, 2622, 2623, 2624, 2625, 2626, 2627,
- 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635,
- 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643,
- 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651,
- 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659,
- 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667,
- 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675,
- 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683,
- 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691,
- 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699,
- 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707,
- 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715,
- 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723,
- 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731,
- 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739,
- 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2747,
- 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2755,
- 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763,
- 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771,
- 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779,
- 2780, 2781, 2782, 2783, 2784, 2785, 2786, 2787,
- 2788, 2789, 2790, 2791, 2792, 2793, 2794, 2795,
- 2796, 2797, 2798, 2799, 2800, 2802, 2804, 2805,
- 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813,
- 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821,
- 2822, 2823, 2824, 2825, 2826, 2827, 2828, 2829,
- 2830, 2831, 2832, 2834, 2836, 2838, 2840, 2841,
- 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849,
- 2850, 2851, 2852, 2853, 2855, 2856, 2857, 2858,
- 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2866,
- 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874,
- 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882,
- 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890,
- 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898,
- 2899, 2900, 2902, 2904, 2905, 2906, 2908, 2909,
- 2911, 2913, 2914, 2915, 2917, 2919, 2920, 2921,
- 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929,
- 2930, 2931, 2932, 2933, 2934, 2935, 2936, 2937,
- 2940, 2943, 2944, 2945, 2946, 2947, 2948, 2949,
- 2951, 2953, 2955, 2956, 2957, 2959, 2961, 2963,
- 2965, 2969, 2971, 2973, 2974, 2975, 2976, 2977,
- 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985,
- 2986, 2987, 2988, 2989, 2990, 2991, 2994, 2997,
- 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005,
- 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013,
- 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021,
- 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029,
- 3030, 3031, 3032, 3033, 3034, 3035, 3036, 3037,
- 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045,
- 3046, 3047, 3048, 3049, 3050, 3051, 3054, 3056,
- 3059, 3062, 3064, 3067, 3070, 3073, 3076, 3077,
- 3080, 3081, 3082, 3083, 3084, 3085, 3089, 3091,
- 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101,
- 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109,
- 3110, 3111, 3112, 3113, 3114, 3115, 3116, 3117,
- 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125,
- 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133,
- 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141,
- 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149,
- 3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158,
- 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166,
- 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174,
- 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182,
- 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190,
- 3193, 3196, 3199, 3202, 3205, 3208, 3211, 3214,
- 3217, 3220, 3223, 3226, 3229, 3232, 3235, 3236,
- 3237, 3238, 3239, 3241, 3242, 3243, 3244, 3245,
- 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253,
- 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261,
- 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269,
- 3270, 3271, 3272, 3273, 3274, 3275, 3276, 3277,
- 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285,
- 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293,
- 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301,
- 3302, 3305, 3308, 3309, 3310, 3311, 3312, 3313,
- 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321,
- 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329,
- 3330, 3331, 3332, 3333, 3334, 3335, 3336, 3337,
- 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345,
- 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353,
- 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361,
- 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369,
- 3370, 3373, 3376, 3379, 3380, 3381, 3382, 3383,
- 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391,
- 3392, 3393, 3394, 3395, 3398, 3401, 3402, 3403,
- 3406, 3407, 3408, 3409, 3410, 3413, 3416, 3419,
- 3420, 3421, 3422, 3423, 3424, 3425, 3426, 3427,
- 3428, 3429, 3431, 3433, 3434, 3435, 3436, 3437,
- 3438, 3439, 3440, 3441, 3442, 3443, 3444, 3445,
- 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453,
- 3454, 3455, 3456, 3457, 3458, 3460, 3462, 3463,
- 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471,
- 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479,
- 3480, 3481, 3482, 3483, 3484, 3485, 3486, 3487,
- 3489, 3491, 3493, 3495, 3496, 3497, 3498, 3499,
- 3500, 3501, 3502, 3503, 3504, 3505, 3506, 3507,
- 3508, 3509, 3510, 3512, 3513, 3515, 3518, 3520,
- 3521, 3522, 3524, 3526, 3527, 3528, 3529, 3530,
- 3531, 3532, 3534, 3536, 3538, 3540, 3541, 3542,
- 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3551,
- 3553, 3554, 3556, 3558, 3559, 3564, 3566, 3568,
- 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3577,
- 3579, 3580, 3581, 3582, 3584, 3587, 3590, 3593,
- 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602,
- 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610,
- 3611, 3612, 3613, 3614, 3615, 3617, 3619, 3621,
- 3623, 3625, 3627, 3629, 3631, 3633, 3635, 3636,
- 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644,
- 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652,
- 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660,
- 3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668,
- 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676,
- 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684,
- 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692,
- 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700,
- 3701, 3702, 3703, 3704, 3705, 3706, 3707, 3708,
- 3709, 3710, 3711, 3712, 3713, 3714, 3715, 3716,
- 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724,
- 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732,
- 3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740,
- 3741, 3742, 3743, 3744, 3745, 3746, 3747, 3750,
- 3751, 3752, 3755, 3756, 3757, 3759, 3760, 3761,
- 3762, 3764, 3765, 3766, 3767, 3769, 3770, 3771,
- 3772, 3775, 3776, 3777, 3778, 3779, 3782, 3785,
- 3788, 3791, 3794, 3795, 3796, 3797, 3798, 3800,
- 3802, 3803, 3804, 3805, 3808, 3811, 3814, 3817,
- 3820, 3821, 3822, 3823, 3825, 3826, 3827, 3828,
- 3830, 3831, 3832, 3833, 3834, 3835, 3836, 3837,
- 3838, 3839, 3840, 3841, 3842, 3843, 3844, 3845,
- 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853,
- 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861,
- 3862, 3863, 3864, 3865, 3866, 3867, 3868, 3869,
- 3871, 3873, 3875, 3877, 3879, 3880, 3881, 3884,
- 3887, 3888, 3889, 3890, 3891
+ 1584, 1586, 1588, 1589, 1590, 1591, 1592, 1594,
+ 1597, 1599, 1601, 1603, 1605, 1607, 1609, 1611,
+ 1613, 1615, 1617, 1619, 1621, 1623, 1625, 1627,
+ 1629, 1631, 1633, 1635, 1637, 1639, 1641, 1643,
+ 1645, 1647, 1649, 1651, 1653, 1655, 1657, 1659,
+ 1661, 1663, 1665, 1667, 1669, 1671, 1673, 1675,
+ 1677, 1679, 1681, 1683, 1685, 1687, 1689, 1691,
+ 1693, 1695, 1697, 1699, 1701, 1703, 1705, 1707,
+ 1709, 1711, 1713, 1715, 1717, 1719, 1721, 1723,
+ 1725, 1727, 1729, 1731, 1733, 1735, 1737, 1739,
+ 1741, 1743, 1745, 1747, 1749, 1751, 1753, 1755,
+ 1757, 1759, 1761, 1763, 1765, 1767, 1769, 1771,
+ 1773, 1775, 1777, 1779, 1781, 1783, 1785, 1787,
+ 1789, 1791, 1793, 1795, 1797, 1799, 1801, 1803,
+ 1805, 1807, 1809, 1811, 1813, 1815, 1817, 1819,
+ 1821, 1823, 1825, 1827, 1829, 1831, 1833, 1835,
+ 1837, 1839, 1841, 1843, 1845, 1847, 1849, 1851,
+ 1853, 1855, 1857, 1859, 1861, 1863, 1865, 1867,
+ 1869, 1871, 1873, 1875, 1877, 1879, 1881, 1883,
+ 1885, 1887, 1889, 1891, 1893, 1895, 1897, 1899,
+ 1901, 1903, 1905, 1907, 1909, 1911, 1913, 1915,
+ 1917, 1919, 1921, 1923, 1925, 1927, 1929, 1931,
+ 1933, 1935, 1937, 1939, 1941, 1943, 1945, 1947,
+ 1949, 1951, 1953, 1955, 1957, 1959, 1961, 1963,
+ 1965, 1967, 1969, 1971, 1973, 1975, 1977, 1979,
+ 1984, 1986, 1991, 1993, 1995, 2000, 2002, 2004,
+ 2006, 2011, 2013, 2015, 2017, 2021, 2027, 2029,
+ 2034, 2036, 2038, 2040, 2042, 2044, 2046, 2048,
+ 2050, 2052, 2053, 2054, 2056, 2058, 2059, 2060,
+ 2061, 2062, 2064, 2066, 2067, 2068, 2069, 2071,
+ 2073, 2075, 2077, 2079, 2081, 2083, 2085, 2087,
+ 2089, 2091, 2093, 2095, 2099, 2100, 2101, 2103,
+ 2107, 2111, 2113, 2117, 2121, 2122, 2123, 2125,
+ 2127, 2129, 2131, 2136, 2140, 2144, 2146, 2148,
+ 2150, 2152, 2153, 2155, 2157, 2159, 2161, 2163,
+ 2165, 2167, 2169, 2171, 2173, 2175, 2177, 2179,
+ 2181, 2183, 2185, 2187, 2189, 2191, 2193, 2195,
+ 2197, 2198, 2199, 2201, 2203, 2204, 2205, 2208,
+ 2211, 2214, 2217, 2219, 2221, 2223, 2225, 2227,
+ 2229, 2230, 2231, 2232, 2234, 2238, 2240, 2242,
+ 2248, 2252, 2253, 2254, 2255, 2256, 2257, 2258,
+ 2259, 2263, 2265, 2267, 2271, 2273, 2275, 2277,
+ 2279, 2281, 2283, 2285, 2287, 2289, 2291, 2293,
+ 2295, 2297, 2299, 2300, 2303, 2306, 2311, 2316,
+ 2319, 2322, 2325, 2328, 2333, 2338, 2341, 2344,
+ 2346, 2348, 2350, 2352, 2354, 2356, 2358, 2359,
+ 2361, 2363, 2365, 2367, 2369, 2370, 2371, 2372,
+ 2376, 2380, 2382, 2386, 2390, 2394, 2398, 2402,
+ 2404, 2408, 2410, 2412, 2414, 2416, 2418, 2420,
+ 2422, 2424, 2425, 2427, 2429, 2431, 2433, 2435,
+ 2437, 2439, 2441, 2442, 2443, 2444, 2446, 2448,
+ 2450, 2452, 2453, 2454, 2456, 2458, 2460, 2462,
+ 2464, 2466, 2467, 2469, 2471, 2473, 2475, 2476,
+ 2477, 2479, 2481, 2483, 2485, 2487, 2489, 2491,
+ 2493, 2494, 2495, 2497, 2498, 2501, 2504, 2506,
+ 2509, 2510, 2511, 2513, 2514, 2516, 2518, 2520,
+ 2522, 2524, 2525, 2526, 2527, 2528, 2529, 2532,
+ 2537, 2542, 2547, 2552, 2555, 2560, 2565, 2567,
+ 2569, 2571, 2573, 2574, 2575, 2577, 2579, 2581,
+ 2583, 2585, 2587, 2589, 2590, 2591, 2592, 2593,
+ 2594, 2595, 2600, 2605, 2606, 2607, 2608, 2609,
+ 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617,
+ 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625,
+ 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633,
+ 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641,
+ 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649,
+ 2650, 2651, 2652, 2653, 2654, 2655, 2656, 2657,
+ 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665,
+ 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673,
+ 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681,
+ 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689,
+ 2690, 2691, 2692, 2693, 2694, 2695, 2696, 2697,
+ 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705,
+ 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713,
+ 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721,
+ 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729,
+ 2730, 2731, 2732, 2733, 2734, 2735, 2736, 2737,
+ 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745,
+ 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753,
+ 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761,
+ 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769,
+ 2770, 2771, 2772, 2773, 2774, 2775, 2776, 2777,
+ 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785,
+ 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793,
+ 2794, 2795, 2796, 2797, 2798, 2799, 2800, 2801,
+ 2802, 2803, 2804, 2805, 2806, 2808, 2810, 2811,
+ 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819,
+ 2820, 2821, 2822, 2823, 2824, 2825, 2826, 2827,
+ 2828, 2829, 2830, 2831, 2832, 2833, 2834, 2835,
+ 2836, 2837, 2838, 2840, 2842, 2844, 2846, 2847,
+ 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2855,
+ 2856, 2857, 2858, 2859, 2861, 2862, 2863, 2864,
+ 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872,
+ 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880,
+ 2881, 2882, 2883, 2884, 2885, 2886, 2887, 2888,
+ 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896,
+ 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904,
+ 2905, 2906, 2908, 2910, 2911, 2912, 2914, 2915,
+ 2917, 2919, 2920, 2921, 2923, 2925, 2926, 2927,
+ 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935,
+ 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943,
+ 2946, 2949, 2950, 2951, 2952, 2953, 2954, 2955,
+ 2957, 2959, 2961, 2962, 2963, 2965, 2967, 2969,
+ 2971, 2975, 2977, 2979, 2980, 2981, 2982, 2983,
+ 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991,
+ 2992, 2993, 2994, 2995, 2996, 2997, 3000, 3003,
+ 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011,
+ 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019,
+ 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3027,
+ 3028, 3029, 3030, 3031, 3032, 3033, 3034, 3035,
+ 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043,
+ 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051,
+ 3052, 3053, 3054, 3055, 3056, 3057, 3060, 3062,
+ 3065, 3068, 3070, 3073, 3076, 3079, 3082, 3083,
+ 3086, 3087, 3088, 3089, 3090, 3091, 3095, 3097,
+ 3100, 3101, 3102, 3103, 3104, 3105, 3106, 3107,
+ 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115,
+ 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123,
+ 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131,
+ 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139,
+ 3140, 3141, 3142, 3143, 3144, 3145, 3146, 3147,
+ 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3155,
+ 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164,
+ 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172,
+ 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180,
+ 3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188,
+ 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196,
+ 3199, 3202, 3205, 3208, 3211, 3214, 3217, 3220,
+ 3223, 3226, 3229, 3232, 3235, 3238, 3241, 3242,
+ 3243, 3244, 3245, 3247, 3248, 3249, 3250, 3251,
+ 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259,
+ 3260, 3261, 3262, 3263, 3264, 3265, 3266, 3267,
+ 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275,
+ 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283,
+ 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291,
+ 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299,
+ 3300, 3301, 3302, 3303, 3304, 3305, 3306, 3307,
+ 3308, 3311, 3314, 3315, 3316, 3317, 3318, 3319,
+ 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3327,
+ 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335,
+ 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343,
+ 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351,
+ 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359,
+ 3360, 3361, 3362, 3363, 3364, 3365, 3366, 3367,
+ 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375,
+ 3376, 3379, 3382, 3385, 3386, 3387, 3388, 3389,
+ 3390, 3391, 3392, 3393, 3394, 3395, 3396, 3397,
+ 3398, 3399, 3400, 3401, 3404, 3407, 3408, 3409,
+ 3412, 3413, 3414, 3415, 3416, 3419, 3422, 3425,
+ 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433,
+ 3434, 3435, 3437, 3439, 3440, 3441, 3442, 3443,
+ 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451,
+ 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459,
+ 3460, 3461, 3462, 3463, 3464, 3466, 3468, 3469,
+ 3470, 3471, 3472, 3473, 3474, 3475, 3476, 3477,
+ 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485,
+ 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493,
+ 3495, 3497, 3499, 3501, 3502, 3503, 3504, 3505,
+ 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513,
+ 3514, 3515, 3516, 3518, 3519, 3521, 3524, 3526,
+ 3527, 3528, 3530, 3532, 3533, 3534, 3535, 3536,
+ 3537, 3538, 3540, 3542, 3544, 3546, 3547, 3548,
+ 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3557,
+ 3559, 3560, 3562, 3564, 3565, 3570, 3572, 3574,
+ 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3583,
+ 3585, 3586, 3587, 3588, 3590, 3593, 3596, 3599,
+ 3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608,
+ 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616,
+ 3617, 3618, 3619, 3620, 3621, 3623, 3625, 3627,
+ 3629, 3631, 3633, 3635, 3637, 3639, 3641, 3642,
+ 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650,
+ 3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658,
+ 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666,
+ 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674,
+ 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682,
+ 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690,
+ 3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698,
+ 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3706,
+ 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714,
+ 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722,
+ 3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730,
+ 3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738,
+ 3739, 3740, 3741, 3742, 3743, 3744, 3745, 3746,
+ 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3756,
+ 3757, 3758, 3761, 3762, 3763, 3765, 3766, 3767,
+ 3768, 3770, 3771, 3772, 3773, 3775, 3776, 3777,
+ 3778, 3781, 3782, 3783, 3784, 3785, 3788, 3791,
+ 3794, 3797, 3800, 3801, 3802, 3803, 3804, 3806,
+ 3808, 3809, 3810, 3811, 3814, 3817, 3820, 3823,
+ 3826, 3827, 3828, 3829, 3831, 3832, 3833, 3834,
+ 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843,
+ 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851,
+ 3852, 3853, 3854, 3855, 3856, 3857, 3858, 3859,
+ 3860, 3861, 3862, 3863, 3864, 3865, 3866, 3867,
+ 3868, 3869, 3870, 3871, 3872, 3873, 3874, 3875,
+ 3877, 3879, 3881, 3883, 3885, 3886, 3887, 3890,
+ 3893, 3894, 3895, 3896, 3897
};
/* i386 mnemonics table. */
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d binutils-2.41/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d
--- binutils.orig/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d 2024-02-12 15:55:20.792572349 +0000
+++ binutils-2.41/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d 2024-02-12 15:56:07.355601128 +0000
@@ -158,6 +158,12 @@ Disassembly of section \.text:
[ ]*[a-f0-9]+:[ ]*62 da 7f 08 4b b4 87 23 01 00 00[ ]+tileloadd tmm6,\[r31\+rax\*4\+0x123\]
[ ]*[a-f0-9]+:[ ]*62 da 7d 08 4b b4 87 23 01 00 00[ ]+tileloaddt1 tmm6,\[r31\+rax\*4\+0x123\]
[ ]*[a-f0-9]+:[ ]*62 da 7e 08 4b b4 87 23 01 00 00[ ]+tilestored[ ]+\[r31\+rax\*4\+0x123\],tmm6
+[ ]*[a-f0-9]+:[ ]*62 fa 7d 28 1a 18[ ]+vbroadcastf32x4 ymm3,XMMWORD PTR \[r16\]
+[ ]*[a-f0-9]+:[ ]*62 fa 7d 28 5a 18[ ]+vbroadcasti32x4 ymm3,XMMWORD PTR \[r16\]
+[ ]*[a-f0-9]+:[ ]*62 fb 7d 28 19 18 01[ ]+vextractf32x4 XMMWORD PTR \[r16\],ymm3,(0x)?1
+[ ]*[a-f0-9]+:[ ]*62 fb 7d 28 39 18 01[ ]+vextracti32x4 XMMWORD PTR \[r16\],ymm3,(0x)?1
+[ ]*[a-f0-9]+:[ ]*62 7b 65 28 18 00 01[ ]+vinsertf32x4 ymm8,ymm3,XMMWORD PTR \[r16\],(0x)?1
+[ ]*[a-f0-9]+:[ ]*62 7b 65 28 38 00 01[ ]+vinserti32x4 ymm8,ymm3,XMMWORD PTR \[r16\],(0x)?1
[ ]*[a-f0-9]+:[ ]*62 db fd 08 09 30 01[ ]+vrndscalepd xmm6,XMMWORD PTR \[r24\],(0x)?1
[ ]*[a-f0-9]+:[ ]*62 db 7d 08 08 30 02[ ]+vrndscaleps xmm6,XMMWORD PTR \[r24\],(0x)?2
[ ]*[a-f0-9]+:[ ]*62 db cd 08 0b 18 03[ ]+vrndscalesd xmm3,xmm6,QWORD PTR \[r24\],(0x)?3
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.d binutils-2.41/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.d
--- binutils.orig/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.d 2024-02-12 15:55:20.792572349 +0000
+++ binutils-2.41/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.d 2024-02-12 15:56:07.355601128 +0000
@@ -158,6 +158,12 @@ Disassembly of section \.text:
[ ]*[a-f0-9]+:[ ]*62 da 7f 08 4b b4 87 23 01 00 00[ ]+tileloadd[ ]+0x123\(%r31,%rax,4\),%tmm6
[ ]*[a-f0-9]+:[ ]*62 da 7d 08 4b b4 87 23 01 00 00[ ]+tileloaddt1[ ]+0x123\(%r31,%rax,4\),%tmm6
[ ]*[a-f0-9]+:[ ]*62 da 7e 08 4b b4 87 23 01 00 00[ ]+tilestored[ ]+%tmm6,0x123\(%r31,%rax,4\)
+[ ]*[a-f0-9]+:[ ]*62 fa 7d 28 1a 18[ ]+vbroadcastf32x4 \(%r16\),%ymm3
+[ ]*[a-f0-9]+:[ ]*62 fa 7d 28 5a 18[ ]+vbroadcasti32x4 \(%r16\),%ymm3
+[ ]*[a-f0-9]+:[ ]*62 fb 7d 28 19 18 01[ ]+vextractf32x4 \$(0x)?1,%ymm3,\(%r16\)
+[ ]*[a-f0-9]+:[ ]*62 fb 7d 28 39 18 01[ ]+vextracti32x4 \$(0x)?1,%ymm3,\(%r16\)
+[ ]*[a-f0-9]+:[ ]*62 7b 65 28 18 00 01[ ]+vinsertf32x4 \$(0x)?1,\(%r16\),%ymm3,%ymm8
+[ ]*[a-f0-9]+:[ ]*62 7b 65 28 38 00 01[ ]+vinserti32x4 \$(0x)?1,\(%r16\),%ymm3,%ymm8
[ ]*[a-f0-9]+:[ ]*62 db fd 08 09 30 01[ ]+vrndscalepd \$0x1,\(%r24\),%xmm6
[ ]*[a-f0-9]+:[ ]*62 db 7d 08 08 30 02[ ]+vrndscaleps \$0x2,\(%r24\),%xmm6
[ ]*[a-f0-9]+:[ ]*62 db cd 08 0b 18 03[ ]+vrndscalesd \$0x3,\(%r24\),%xmm6,%xmm3
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.s binutils-2.41/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.s
--- binutils.orig/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.s 2024-02-12 15:55:20.792572349 +0000
+++ binutils-2.41/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.s 2024-02-12 15:56:07.356601129 +0000
@@ -152,6 +152,12 @@ _start:
tileloadd 0x123(%r31,%rax,4),%tmm6
tileloaddt1 0x123(%r31,%rax,4),%tmm6
tilestored %tmm6,0x123(%r31,%rax,4)
+ vbroadcastf128 (%r16),%ymm3
+ vbroadcasti128 (%r16),%ymm3
+ vextractf128 $1,%ymm3,(%r16)
+ vextracti128 $1,%ymm3,(%r16)
+ vinsertf128 $1,(%r16),%ymm3,%ymm8
+ vinserti128 $1,(%r16),%ymm3,%ymm8
vroundpd $1,(%r24),%xmm6
vroundps $2,(%r24),%xmm6
vroundsd $3,(%r24),%xmm6,%xmm3

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,139 @@
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 4592bd6da27..4faf642b422 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -3675,7 +3675,7 @@ group_sections (struct elf_aarch64_link_hash_table *htab,
/* True if the inserted stub does not break BTI compatibility. */
static bool
-aarch64_bti_stub_p (bfd *input_bfd,
+aarch64_bti_stub_p (struct bfd_link_info *info,
struct elf_aarch64_stub_hash_entry *stub_entry)
{
/* Stubs without indirect branch are BTI compatible. */
@@ -3685,12 +3685,22 @@ aarch64_bti_stub_p (bfd *input_bfd,
/* Return true if the target instruction is compatible with BR x16. */
+ struct elf_aarch64_link_hash_table *globals = elf_aarch64_hash_table (info);
asection *section = stub_entry->target_section;
bfd_byte loc[4];
file_ptr off = stub_entry->target_value;
bfd_size_type count = sizeof (loc);
- if (!bfd_get_section_contents (input_bfd, section, loc, off, count))
+ /* PLT code is not generated yet, so treat it specially.
+ Note: Checking elf_aarch64_obj_tdata.plt_type & PLT_BTI is not
+ enough because it only implies BTI in the PLT0 and tlsdesc PLT
+ entries. Normal PLT entries don't have BTI in a shared library
+ (because such PLT is normally not called indirectly and adding
+ the BTI when a stub targets a PLT would change the PLT layout
+ and it's too late for that here). */
+ if (section == globals->root.splt)
+ memcpy (loc, globals->plt_entry, count);
+ else if (!bfd_get_section_contents (section->owner, section, loc, off, count))
return false;
uint32_t insn = bfd_getl32 (loc);
@@ -4637,11 +4647,24 @@ _bfd_aarch64_add_call_stub_entries (bool *stub_changed, bfd *output_bfd,
/* A stub with indirect jump may break BTI compatibility, so
insert another stub with direct jump near the target then. */
- if (need_bti && !aarch64_bti_stub_p (input_bfd, stub_entry))
+ if (need_bti && !aarch64_bti_stub_p (info, stub_entry))
{
+ id_sec_bti = htab->stub_group[sym_sec->id].link_sec;
+
+ /* If the stub with indirect jump and the BTI stub are in
+ the same stub group: change the indirect jump stub into
+ a BTI stub since a direct branch can reach the target.
+ The BTI landing pad is still needed in case another
+ stub indirectly jumps to it. */
+ if (id_sec_bti == id_sec)
+ {
+ stub_entry->stub_type = aarch64_stub_bti_direct_branch;
+ goto skip_double_stub;
+ }
+
stub_entry->double_stub = true;
htab->has_double_stub = true;
- id_sec_bti = htab->stub_group[sym_sec->id].link_sec;
+
stub_name_bti =
elfNN_aarch64_stub_name (id_sec_bti, sym_sec, hash, irela);
if (!stub_name_bti)
@@ -4653,33 +4676,41 @@ _bfd_aarch64_add_call_stub_entries (bool *stub_changed, bfd *output_bfd,
stub_entry_bti =
aarch64_stub_hash_lookup (&htab->stub_hash_table,
stub_name_bti, false, false);
- if (stub_entry_bti == NULL)
- stub_entry_bti =
- _bfd_aarch64_add_stub_entry_in_group (stub_name_bti,
- sym_sec, htab);
- if (stub_entry_bti == NULL)
+ if (stub_entry_bti != NULL)
+ BFD_ASSERT (stub_entry_bti->stub_type
+ == aarch64_stub_bti_direct_branch);
+ else
{
- free (stub_name);
- free (stub_name_bti);
- goto error_ret_free_internal;
- }
-
- stub_entry_bti->target_value = sym_value + irela->r_addend;
- stub_entry_bti->target_section = sym_sec;
- stub_entry_bti->stub_type = aarch64_stub_bti_direct_branch;
- stub_entry_bti->h = hash;
- stub_entry_bti->st_type = st_type;
+ stub_entry_bti =
+ _bfd_aarch64_add_stub_entry_in_group (stub_name_bti,
+ sym_sec, htab);
+ if (stub_entry_bti == NULL)
+ {
+ free (stub_name);
+ free (stub_name_bti);
+ goto error_ret_free_internal;
+ }
- len = sizeof (BTI_STUB_ENTRY_NAME) + strlen (sym_name);
- stub_entry_bti->output_name = bfd_alloc (htab->stub_bfd, len);
- if (stub_entry_bti->output_name == NULL)
- {
- free (stub_name);
- free (stub_name_bti);
- goto error_ret_free_internal;
+ stub_entry_bti->target_value =
+ sym_value + irela->r_addend;
+ stub_entry_bti->target_section = sym_sec;
+ stub_entry_bti->stub_type =
+ aarch64_stub_bti_direct_branch;
+ stub_entry_bti->h = hash;
+ stub_entry_bti->st_type = st_type;
+
+ len = sizeof (BTI_STUB_ENTRY_NAME) + strlen (sym_name);
+ stub_entry_bti->output_name = bfd_alloc (htab->stub_bfd,
+ len);
+ if (stub_entry_bti->output_name == NULL)
+ {
+ free (stub_name);
+ free (stub_name_bti);
+ goto error_ret_free_internal;
+ }
+ snprintf (stub_entry_bti->output_name, len,
+ BTI_STUB_ENTRY_NAME, sym_name);
}
- snprintf (stub_entry_bti->output_name, len,
- BTI_STUB_ENTRY_NAME, sym_name);
/* Update the indirect call stub to target the BTI stub. */
stub_entry->target_value = 0;
@@ -4688,7 +4719,7 @@ _bfd_aarch64_add_call_stub_entries (bool *stub_changed, bfd *output_bfd,
stub_entry->h = NULL;
stub_entry->st_type = STT_FUNC;
}
-
+skip_double_stub:
*stub_changed = true;
}

View File

@ -0,0 +1,11 @@
--- binutils.orig/config/override.m4 2021-08-31 14:20:17.275574804 +0100
+++ binutils-2.37/config/override.m4 2021-08-31 14:36:37.793954247 +0100
@@ -41,7 +41,7 @@ dnl Or for updating the whole tree at on
AC_DEFUN([_GCC_AUTOCONF_VERSION_CHECK],
[m4_if(m4_defn([_GCC_AUTOCONF_VERSION]),
m4_defn([m4_PACKAGE_VERSION]), [],
- [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])])
+ [])
])
m4_define([AC_INIT], m4_defn([AC_INIT])[
_GCC_AUTOCONF_VERSION_CHECK

View File

@ -0,0 +1,29 @@
--- binutils.orig/bfd/merge.c 2023-11-07 09:49:56.923358543 +0000
+++ binutils-2.41/bfd/merge.c 2023-11-07 09:51:47.031552039 +0000
@@ -167,7 +167,7 @@ static bool
sec_merge_maybe_resize (struct sec_merge_hash *table, unsigned added)
{
struct bfd_hash_table *bfdtab = &table->table;
- if (bfdtab->count + added > table->nbuckets * 2 / 3)
+ if (bfdtab->count + added > table->nbuckets / 3 * 2)
{
unsigned i;
unsigned long newnb = table->nbuckets * 2;
@@ -175,7 +175,7 @@ sec_merge_maybe_resize (struct sec_merge
uint64_t *newl;
unsigned long alloc;
- while (bfdtab->count + added > newnb * 2 / 3)
+ while (bfdtab->count + added > newnb / 3 * 2)
{
newnb *= 2;
if (!newnb)
@@ -240,7 +240,7 @@ sec_merge_hash_insert (struct sec_merge_
hashp->u.suffix = NULL;
hashp->next = NULL;
// We must not need resizing, otherwise _index is wrong
- BFD_ASSERT (bfdtab->count + 1 <= table->nbuckets * 2 / 3);
+ BFD_ASSERT (bfdtab->count + 1 <= table->nbuckets / 3 * 2);
bfdtab->count++;
table->key_lens[_index] = (hash << 32) | (uint32_t)len;
table->values[_index] = hashp;

View File

@ -0,0 +1,374 @@
--- binutils.orig/include/demangle.h 2024-01-17 09:54:10.945686323 +0000
+++ binutils-2.41/include/demangle.h 2024-01-17 09:54:55.696760281 +0000
@@ -1,5 +1,5 @@
/* Defs for interface to demanglers.
- Copyright (C) 1992-2023 Free Software Foundation, Inc.
+ Copyright (C) 1992-2024 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License
@@ -448,6 +448,8 @@ enum demangle_component_type
DEMANGLE_COMPONENT_TRANSACTION_SAFE,
/* A cloned function. */
DEMANGLE_COMPONENT_CLONE,
+ /* A member-like friend function. */
+ DEMANGLE_COMPONENT_FRIEND,
DEMANGLE_COMPONENT_NOEXCEPT,
DEMANGLE_COMPONENT_THROW_SPEC,
@@ -464,6 +466,8 @@ enum demangle_component_type
DEMANGLE_COMPONENT_TEMPLATE_TEMPLATE_PARM,
DEMANGLE_COMPONENT_TEMPLATE_PACK_PARM,
+ DEMANGLE_COMPONENT_CONSTRAINTS,
+
/* A builtin type with argument. This holds the builtin type
information. */
DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE
diff -rup binutils.orig/libiberty/cp-demangle.c binutils-2.41/libiberty/cp-demangle.c
--- binutils.orig/libiberty/cp-demangle.c 2024-01-17 09:54:11.323686947 +0000
+++ binutils-2.41/libiberty/cp-demangle.c 2024-01-17 09:54:42.468738420 +0000
@@ -1,5 +1,5 @@
/* Demangler for g++ V3 ABI.
- Copyright (C) 2003-2023 Free Software Foundation, Inc.
+ Copyright (C) 2003-2024 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@wasabisystems.com>.
This file is part of the libiberty library, which is part of GCC.
@@ -993,6 +993,7 @@ d_make_comp (struct d_info *di, enum dem
case DEMANGLE_COMPONENT_VECTOR_TYPE:
case DEMANGLE_COMPONENT_CLONE:
case DEMANGLE_COMPONENT_MODULE_ENTITY:
+ case DEMANGLE_COMPONENT_CONSTRAINTS:
if (left == NULL || right == NULL)
return NULL;
break;
@@ -1036,6 +1037,7 @@ d_make_comp (struct d_info *di, enum dem
case DEMANGLE_COMPONENT_TEMPLATE_NON_TYPE_PARM:
case DEMANGLE_COMPONENT_TEMPLATE_TEMPLATE_PARM:
case DEMANGLE_COMPONENT_TEMPLATE_PACK_PARM:
+ case DEMANGLE_COMPONENT_FRIEND:
if (left == NULL)
return NULL;
break;
@@ -1344,6 +1346,22 @@ is_ctor_dtor_or_conversion (struct deman
}
}
+/* [ Q <constraint-expression> ] */
+
+static struct demangle_component *
+d_maybe_constraints (struct d_info *di, struct demangle_component *dc)
+{
+ if (d_peek_char (di) == 'Q')
+ {
+ d_advance (di, 1);
+ struct demangle_component *expr = d_expression (di);
+ if (expr == NULL)
+ return NULL;
+ dc = d_make_comp (di, DEMANGLE_COMPONENT_CONSTRAINTS, dc, expr);
+ }
+ return dc;
+}
+
/* <encoding> ::= <(function) name> <bare-function-type>
::= <(data) name>
::= <special-name>
@@ -1397,21 +1415,21 @@ d_encoding (struct d_info *di, int top_l
struct demangle_component *ftype;
ftype = d_bare_function_type (di, has_return_type (dc));
- if (ftype)
- {
- /* If this is a non-top-level local-name, clear the
- return type, so it doesn't confuse the user by
- being confused with the return type of whaever
- this is nested within. */
- if (!top_level && dc->type == DEMANGLE_COMPONENT_LOCAL_NAME
- && ftype->type == DEMANGLE_COMPONENT_FUNCTION_TYPE)
- d_left (ftype) = NULL;
+ if (!ftype)
+ return NULL;
- dc = d_make_comp (di, DEMANGLE_COMPONENT_TYPED_NAME,
- dc, ftype);
- }
- else
- dc = NULL;
+ /* If this is a non-top-level local-name, clear the
+ return type, so it doesn't confuse the user by
+ being confused with the return type of whaever
+ this is nested within. */
+ if (!top_level && dc->type == DEMANGLE_COMPONENT_LOCAL_NAME
+ && ftype->type == DEMANGLE_COMPONENT_FUNCTION_TYPE)
+ d_left (ftype) = NULL;
+
+ ftype = d_maybe_constraints (di, ftype);
+
+ dc = d_make_comp (di, DEMANGLE_COMPONENT_TYPED_NAME,
+ dc, ftype);
}
}
}
@@ -1681,6 +1699,7 @@ d_maybe_module_name (struct d_info *di,
/* <unqualified-name> ::= [<module-name>] <operator-name> [<abi-tags>]
::= [<module-name>] <ctor-dtor-name> [<abi-tags>]
::= [<module-name>] <source-name> [<abi-tags>]
+ ::= [<module-name>] F <source-name> [<abi-tags>]
::= [<module-name>] <local-source-name> [<abi-tags>]
::= [<module-name>] DC <source-name>+ E [<abi-tags>]
<local-source-name> ::= L <source-name> <discriminator> [<abi-tags>]
@@ -1692,11 +1711,18 @@ d_unqualified_name (struct d_info *di, s
{
struct demangle_component *ret;
char peek;
+ int member_like_friend = 0;
if (!d_maybe_module_name (di, &module))
return NULL;
peek = d_peek_char (di);
+ if (peek == 'F')
+ {
+ member_like_friend = 1;
+ d_advance (di, 1);
+ peek = d_peek_char (di);
+ }
if (IS_DIGIT (peek))
ret = d_source_name (di);
else if (IS_LOWER (peek))
@@ -1773,6 +1799,8 @@ d_unqualified_name (struct d_info *di, s
ret = d_make_comp (di, DEMANGLE_COMPONENT_MODULE_ENTITY, ret, module);
if (d_peek_char (di) == 'B')
ret = d_abi_tags (di, ret);
+ if (member_like_friend)
+ ret = d_make_comp (di, DEMANGLE_COMPONENT_FRIEND, ret, NULL);
if (scope)
ret = d_make_comp (di, DEMANGLE_COMPONENT_QUAL_NAME, scope, ret);
@@ -3012,7 +3040,7 @@ d_parmlist (struct d_info *di)
struct demangle_component *type;
char peek = d_peek_char (di);
- if (peek == '\0' || peek == 'E' || peek == '.')
+ if (peek == '\0' || peek == 'E' || peek == '.' || peek == 'Q')
break;
if ((peek == 'R' || peek == 'O')
&& d_peek_next_char (di) == 'E')
@@ -3248,7 +3276,7 @@ d_template_args (struct d_info *di)
return d_template_args_1 (di);
}
-/* <template-arg>* E */
+/* <template-arg>* [Q <constraint-expression>] E */
static struct demangle_component *
d_template_args_1 (struct d_info *di)
@@ -3284,13 +3312,17 @@ d_template_args_1 (struct d_info *di)
return NULL;
pal = &d_right (*pal);
- if (d_peek_char (di) == 'E')
- {
- d_advance (di, 1);
- break;
- }
+ char peek = d_peek_char (di);
+ if (peek == 'E' || peek == 'Q')
+ break;
}
+ al = d_maybe_constraints (di, al);
+
+ if (d_peek_char (di) != 'E')
+ return NULL;
+ d_advance (di, 1);
+
di->last_name = hold_last_name;
return al;
@@ -4431,6 +4463,7 @@ d_count_templates_scopes (struct d_print
case DEMANGLE_COMPONENT_PACK_EXPANSION:
case DEMANGLE_COMPONENT_TAGGED_NAME:
case DEMANGLE_COMPONENT_CLONE:
+ case DEMANGLE_COMPONENT_CONSTRAINTS:
recurse_left_right:
/* PR 89394 - Check for too much recursion. */
if (dpi->recursion > DEMANGLE_RECURSION_LIMIT)
@@ -4459,6 +4492,7 @@ d_count_templates_scopes (struct d_print
case DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS:
case DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS:
case DEMANGLE_COMPONENT_MODULE_ENTITY:
+ case DEMANGLE_COMPONENT_FRIEND:
d_count_templates_scopes (dpi, d_left (dc));
break;
@@ -5189,6 +5223,22 @@ d_print_comp_inner (struct d_print_info
dpt.next = dpi->templates;
dpi->templates = &dpt;
dpt.template_decl = typed_name;
+
+ /* Constraints are mangled as part of the template argument list,
+ so they wrap the _TEMPLATE_ARGLIST. But
+ d_lookup_template_argument expects the RHS of _TEMPLATE to be
+ the _ARGLIST, and constraints need to refer to these args. So
+ move the _CONSTRAINTS out of the _TEMPLATE and onto the type.
+ This will result in them being printed after the () like a
+ trailing requires-clause, but that seems like our best option
+ given that we aren't printing a template-head. */
+ struct demangle_component *tnr = d_right (typed_name);
+ if (tnr->type == DEMANGLE_COMPONENT_CONSTRAINTS)
+ {
+ d_right (typed_name) = d_left (tnr);
+ d_left (tnr) = d_right (dc);
+ d_right (dc) = tnr;
+ }
}
d_print_comp (dpi, options, d_right (dc));
@@ -6197,6 +6247,11 @@ d_print_comp_inner (struct d_print_info
d_append_char (dpi, ']');
return;
+ case DEMANGLE_COMPONENT_FRIEND:
+ d_print_comp (dpi, options, d_left (dc));
+ d_append_string (dpi, "[friend]");
+ return;
+
case DEMANGLE_COMPONENT_TEMPLATE_HEAD:
{
d_append_char (dpi, '<');
@@ -6231,6 +6286,12 @@ d_print_comp_inner (struct d_print_info
d_append_string (dpi, "...");
return;
+ case DEMANGLE_COMPONENT_CONSTRAINTS:
+ d_print_comp (dpi, options, d_left (dc));
+ d_append_string (dpi, " requires ");
+ d_print_comp (dpi, options, d_right (dc));
+ return;
+
default:
d_print_error (dpi);
return;
--- binutils.orig/include/demangle.h 2024-01-17 11:06:11.111229985 +0000
+++ binutils-2.41/include/demangle.h 2024-01-17 11:06:21.281242709 +0000
@@ -314,6 +314,8 @@ enum demangle_component_type
/* C++11: An rvalue reference modifying a member function. The one
subtree is the type which is being referenced. */
DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS,
+ /* C++23: A member function with explict object parameter. */
+ DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION,
/* A vendor qualifier. The left subtree is the type which is being
qualified, and the right subtree is the name of the
qualifier. */
--- binutils.orig/libiberty/cp-demangle.c 2024-01-17 11:06:11.246230153 +0000
+++ binutils-2.41/libiberty/cp-demangle.c 2024-01-17 11:06:21.282242710 +0000
@@ -581,6 +581,7 @@ static char *d_demangle (const char *, i
case DEMANGLE_COMPONENT_CONST_THIS: \
case DEMANGLE_COMPONENT_REFERENCE_THIS: \
case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS: \
+ case DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION: \
case DEMANGLE_COMPONENT_TRANSACTION_SAFE: \
case DEMANGLE_COMPONENT_NOEXCEPT: \
case DEMANGLE_COMPONENT_THROW_SPEC
@@ -749,6 +750,9 @@ d_dump (struct demangle_component *dc, i
case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS:
printf ("rvalue reference this\n");
break;
+ case DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION:
+ printf ("explicit object parameter\n");
+ break;
case DEMANGLE_COMPONENT_TRANSACTION_SAFE:
printf ("transaction_safe this\n");
break;
@@ -1547,6 +1551,8 @@ d_name (struct d_info *di, int substable
/* <nested-name> ::= N [<CV-qualifiers>] [<ref-qualifier>] <prefix> <unqualified-name> E
::= N [<CV-qualifiers>] [<ref-qualifier>] <template-prefix> <template-args> E
+ ::= N H <prefix> <unqualified-name> E
+ ::= N H <template-prefix> <template-args> E
*/
static struct demangle_component *
@@ -1559,13 +1565,24 @@ d_nested_name (struct d_info *di)
if (! d_check_char (di, 'N'))
return NULL;
- pret = d_cv_qualifiers (di, &ret, 1);
- if (pret == NULL)
- return NULL;
+ if (d_peek_char (di) == 'H')
+ {
+ d_advance (di, 1);
+ di->expansion += sizeof "this";
+ pret = &ret;
+ rqual = d_make_comp (di, DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION,
+ NULL, NULL);
+ }
+ else
+ {
+ pret = d_cv_qualifiers (di, &ret, 1);
+ if (pret == NULL)
+ return NULL;
- /* Parse the ref-qualifier now and then attach it
- once we have something to attach it to. */
- rqual = d_ref_qualifier (di, NULL);
+ /* Parse the ref-qualifier now and then attach it
+ once we have something to attach it to. */
+ rqual = d_ref_qualifier (di, NULL);
+ }
*pret = d_prefix (di, 1);
if (*pret == NULL)
@@ -4427,6 +4444,7 @@ d_count_templates_scopes (struct d_print
case DEMANGLE_COMPONENT_CONST_THIS:
case DEMANGLE_COMPONENT_REFERENCE_THIS:
case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS:
+ case DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION:
case DEMANGLE_COMPONENT_TRANSACTION_SAFE:
case DEMANGLE_COMPONENT_NOEXCEPT:
case DEMANGLE_COMPONENT_THROW_SPEC:
@@ -6521,6 +6539,8 @@ d_print_mod (struct d_print_info *dpi, i
case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
d_append_string (dpi, "&&");
return;
+ case DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION:
+ return;
case DEMANGLE_COMPONENT_COMPLEX:
d_append_string (dpi, " _Complex");
return;
@@ -6559,11 +6579,13 @@ d_print_function_type (struct d_print_in
{
int need_paren;
int need_space;
+ int xobj_memfn;
struct d_print_mod *p;
struct d_print_mod *hold_modifiers;
need_paren = 0;
need_space = 0;
+ xobj_memfn = 0;
for (p = mods; p != NULL; p = p->next)
{
if (p->printed)
@@ -6586,7 +6608,8 @@ d_print_function_type (struct d_print_in
need_space = 1;
need_paren = 1;
break;
- FNQUAL_COMPONENT_CASE:
+ case DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION:
+ xobj_memfn = 1;
break;
default:
break;
@@ -6617,6 +6640,8 @@ d_print_function_type (struct d_print_in
d_append_char (dpi, ')');
d_append_char (dpi, '(');
+ if (xobj_memfn)
+ d_append_string (dpi, "this ");
if (d_right (dc) != NULL)
d_print_comp (dpi, options, d_right (dc));

View File

@ -0,0 +1,85 @@
diff -rup binutils.orig/configure binutils-2.40/configure
--- binutils.orig/configure 2023-02-13 14:43:00.728877170 +0000
+++ binutils-2.40/configure 2023-02-13 14:43:13.671864892 +0000
@@ -5442,49 +5442,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.40/configure.ac
--- binutils.orig/configure.ac 2023-02-13 14:43:00.728877170 +0000
+++ binutils-2.40/configure.ac 2023-02-13 14:43:13.671864892 +0000
@@ -1435,26 +1435,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_GDC
ACX_PROG_CMP_IGNORE_INITIAL
Only in binutils-2.40: configure.ac.orig
Only in binutils-2.40: configure.orig

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
diff -rup binutils.orig/bfd/Makefile.am binutils-2.32/bfd/Makefile.am
--- binutils.orig/bfd/Makefile.am 2019-02-08 12:22:51.395684251 +0000
+++ binutils-2.32/bfd/Makefile.am 2019-02-08 12:22:53.970664973 +0000
@@ -33,7 +33,7 @@ bfdlibdir = @bfdlibdir@
bfdincludedir = @bfdincludedir@
bfdlib_LTLIBRARIES = libbfd.la
bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
+ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
else !INSTALL_LIBBFD
# Empty these so that the respective installation directories will not be created.
bfdlibdir =
diff -rup binutils.orig/bfd/Makefile.in binutils-2.32/bfd/Makefile.in
--- binutils.orig/bfd/Makefile.in 2019-02-08 12:21:35.291254044 +0000
+++ binutils-2.32/bfd/Makefile.in 2019-02-08 12:22:10.163992947 +0000
@@ -249,7 +249,7 @@ am__can_run_installinfo = \
esac
am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
+ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
HEADERS = $(bfdinclude_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
@@ -468,7 +468,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel
@INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2)
@INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
-@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h \
+@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h \
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2)
@INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@
@INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la

View File

@ -0,0 +1,47 @@
diff -rup binutils.orig/binutils/testsuite/binutils-all/objcopy.exp binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2024-04-29 13:21:45.598519109 +0100
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp 2024-04-29 14:48:37.656943316 +0100
@@ -1099,7 +1099,7 @@ switch [copy_setup] {
"$OBJCOPY" "$OBJCOPYFLAGS" "$test5"
if [is_elf_format] {
keep_debug_symbols_and_check_links "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test6"
- keep_debug_symbols_for_elf_relocatable "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test7"
+ # keep_debug_symbols_for_elf_relocatable "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test7"
}
}
"0" {
@@ -1110,7 +1110,7 @@ switch [copy_setup] {
"$OBJCOPY" "$OBJCOPYFLAGS" "$test5"
if [is_elf_format] {
keep_debug_symbols_and_check_links "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test6"
- keep_debug_symbols_for_elf_relocatable "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test7"
+ # keep_debug_symbols_for_elf_relocatable "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test7"
}
}
}
@@ -1408,11 +1408,10 @@ proc objcopy_test_without_global_symbol
# The AArch64 and ARM targets preserve mapping symbols
# in object files, so they will fail this test.
-setup_xfail aarch64*-*-* arm*-*-*
+# setup_xfail aarch64*-*-* arm*-*-*
# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
# setup_xfail riscv*-*-*
-
-objcopy_test_without_global_symbol
+# objcopy_test_without_global_symbol
# objcopy remove relocation from executable test
diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin.exp binutils-2.41/ld/testsuite/ld-plugin/plugin.exp
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2024-04-29 13:21:48.205519779 +0100
+++ binutils-2.41/ld/testsuite/ld-plugin/plugin.exp 2024-04-29 13:53:32.183969315 +0100
@@ -136,6 +136,8 @@ if { [istarget riscv*-*-*] } then {
return
}
+return
+
set plugin_tests [list \
[list "load plugin" "-plugin $plugin_path \
$testobjfiles $libs" "" "" "" {{ld plugin-1.d}} "main.x" ] \

View File

@ -0,0 +1,11 @@
--- binutils.orig/gold/dwp.cc 2023-05-02 13:26:44.075148082 +0100
+++ binutils-2.40/gold/dwp.cc 2023-05-02 13:27:16.189130127 +0100
@@ -2418,6 +2418,8 @@ main(int argc, char** argv)
{
Dwo_file exe_file(exe_filename);
exe_file.read_executable(&files);
+ if (files.empty())
+ gold_fatal(_("Could not find any dwo links in specified EXE"));
}
// Add any additional files listed on command line.

View File

@ -0,0 +1,193 @@
diff --git a/gold/i386.cc b/gold/i386.cc
index bf209fe9a86..31161ff091c 100644
--- a/gold/i386.cc
+++ b/gold/i386.cc
@@ -360,7 +360,11 @@ class Target_i386 : public Sized_target<32, false>
got_(NULL), plt_(NULL), got_plt_(NULL), got_irelative_(NULL),
got_tlsdesc_(NULL), global_offset_table_(NULL), rel_dyn_(NULL),
rel_irelative_(NULL), copy_relocs_(elfcpp::R_386_COPY),
- got_mod_index_offset_(-1U), tls_base_symbol_defined_(false)
+ got_mod_index_offset_(-1U), tls_base_symbol_defined_(false),
+ isa_1_used_(0), isa_1_needed_(0),
+ 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)
{ }
// Process the relocations to determine unreferenced sections for
@@ -859,6 +863,21 @@ class Target_i386 : public Sized_target<32, false>
this->rel_dyn_section(layout));
}
+ // Record a target-specific program property in the .note.gnu.property
+ // section.
+ void
+ record_gnu_property(unsigned int, unsigned int, size_t,
+ const unsigned char*, const Object*);
+
+ // Merge the target-specific program properties from the current object.
+ void
+ merge_gnu_properties(const Object*);
+
+ // Finalize the target-specific program properties and add them back to
+ // the layout.
+ void
+ do_finalize_gnu_properties(Layout*) const;
+
// Information about this specific target which we pass to the
// general Target structure.
static const Target::Target_info i386_info;
@@ -898,6 +917,26 @@ class Target_i386 : public Sized_target<32, false>
unsigned int got_mod_index_offset_;
// True if the _TLS_MODULE_BASE_ symbol has been defined.
bool tls_base_symbol_defined_;
+
+ // Target-specific program properties, from .note.gnu.property section.
+ // Each bit represents a specific feature.
+ 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
+ // is absent from an object), the result should be all zeroes.
+ // (See PR ld/23486.)
+ uint32_t object_isa_1_used_;
+ // 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_;
};
const Target::Target_info Target_i386::i386_info =
@@ -1042,6 +1081,126 @@ Target_i386::rel_irelative_section(Layout* layout)
return this->rel_irelative_;
}
+// Record a target-specific program property from the .note.gnu.property
+// section.
+void
+Target_i386::record_gnu_property(
+ unsigned int, unsigned int pr_type,
+ size_t pr_datasz, const unsigned char* pr_data,
+ const Object* object)
+{
+ uint32_t val = 0;
+
+ 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 "
+ "(pr_datasz for property %d is not 4)"),
+ object->name().c_str(), pr_type);
+ return;
+ }
+ val = elfcpp::Swap<32, false>::readval(pr_data);
+ break;
+ default:
+ gold_warning(_("%s: unknown program property type 0x%x "
+ "in .note.gnu.property section"),
+ object->name().c_str(), pr_type);
+ break;
+ }
+
+ switch (pr_type)
+ {
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
+ this->object_isa_1_used_ |= val;
+ break;
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
+ this->isa_1_needed_ |= val;
+ break;
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND:
+ // 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;
+ }
+}
+
+// Merge the target-specific program properties from the current object.
+void
+Target_i386::merge_gnu_properties(const Object*)
+{
+ if (this->seen_first_object_)
+ {
+ // If any object is missing the ISA_1_USED property, we must omit
+ // it from the output file.
+ if (this->object_isa_1_used_ == 0)
+ this->isa_1_used_ = 0;
+ 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
+add_property(Layout* layout, unsigned int pr_type, uint32_t val)
+{
+ unsigned char buf[4];
+ elfcpp::Swap<32, false>::writeval(buf, val);
+ layout->add_gnu_property(elfcpp::NT_GNU_PROPERTY_TYPE_0, pr_type, 4, buf);
+}
+
+// Finalize the target-specific program properties and add them back to
+// the layout.
+void
+Target_i386::do_finalize_gnu_properties(Layout* layout) const
+{
+ if (this->isa_1_used_ != 0)
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_ISA_1_USED,
+ this->isa_1_used_);
+ if (this->isa_1_needed_ != 0)
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED,
+ this->isa_1_needed_);
+ 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.
// The remainder of the section is written while writing the PLT
// in Output_data_plt_i386::do_write.

View File

@ -0,0 +1,16 @@
diff -rup binutils.orig/gold/options.h binutils-2.41/gold/options.h
--- binutils.orig/gold/options.h 2024-01-04 09:52:09.282002253 +0000
+++ binutils-2.41/gold/options.h 2024-01-04 09:52:51.890972630 +0000
@@ -855,6 +855,12 @@ class General_options
N_("(ARM only) Do not warn about objects with incompatible "
"enum sizes"));
+ DEFINE_bool_ignore(error_execstack, options::TWO_DASHES, '\0',
+ N_("Ignored"), N_("Ignored"));
+
+ DEFINE_bool_ignore(error_rwx_segments, options::TWO_DASHES, '\0',
+ N_("Ignored"), N_("Ignored"));
+
DEFINE_special(exclude_libs, options::TWO_DASHES, '\0',
N_("Exclude libraries from automatic export"),
N_(("lib,lib ...")));

View File

@ -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)

View File

@ -0,0 +1,27 @@
diff --git a/gold/options.cc b/gold/options.cc
index c9834b66159..91d7802fffe 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -989,7 +989,7 @@ parse_short_option(int argc, const char** argv, int pos_in_argv_i,
}
// If we're a -z option, we need to parse our argument as a
- // long-option, e.g. "-z stacksize=8192".
+ // long-option, e.g. "-z stack-size=8192".
if (retval == &dash_z)
{
int dummy_i = 0;
diff --git a/gold/options.h b/gold/options.h
index 46f658f23ea..d16e38066da 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -1110,6 +1110,9 @@ class General_options
N_("Generate package metadata note"),
N_("[=JSON]"));
+ DEFINE_bool_ignore(pack_relative_relocs, options::DASH_Z, '\0',
+ N_("Ignored"), N_("Ignored"));
+
DEFINE_bool(pie, options::ONE_DASH, '\0', false,
N_("Create a position independent executable"),
N_("Do not create a position independent executable"));

View File

@ -0,0 +1,71 @@
diff -rup binutils.orig/gold/powerpc.cc binutils-2.41/gold/powerpc.cc
--- binutils.orig/gold/powerpc.cc 2023-08-25 11:21:08.882071604 +0100
+++ binutils-2.41/gold/powerpc.cc 2023-08-25 11:21:26.050081034 +0100
@@ -3714,12 +3714,7 @@ Target_powerpc<size, big_endian>::do_rel
unsigned int prev_brlt_size = 0;
if (pass == 1)
{
- bool thread_safe
- = this->abiversion() < 2 && parameters->options().plt_thread_safe();
- if (size == 64
- && this->abiversion() < 2
- && !thread_safe
- && !parameters->options().user_set_plt_thread_safe())
+ if (size == 64 && this->abiversion() < 2)
{
static const char* const thread_starter[] =
{
@@ -3747,29 +3742,37 @@ Target_powerpc<size, big_endian>::do_rel
/* libgo */
"__go_go",
};
+ bool thread_safe = parameters->options().plt_thread_safe();
- if (parameters->options().shared())
- thread_safe = true;
- else
+ if (!thread_safe
+ && !parameters->options().user_set_plt_thread_safe())
{
- for (unsigned int i = 0;
- i < sizeof(thread_starter) / sizeof(thread_starter[0]);
- i++)
+ if (parameters->options().shared())
+ thread_safe = true;
+ else
{
- Symbol* sym = symtab->lookup(thread_starter[i], NULL);
- thread_safe = (sym != NULL
- && sym->in_reg()
- && sym->in_real_elf());
- if (thread_safe)
- break;
+ for (unsigned int i = 0;
+ i < sizeof(thread_starter) / sizeof(thread_starter[0]);
+ i++)
+ {
+ Symbol* sym = symtab->lookup(thread_starter[i], NULL);
+ thread_safe = (sym != NULL
+ && sym->in_reg()
+ && sym->in_real_elf());
+ if (thread_safe)
+ break;
+ }
}
}
+ this->plt_thread_safe_ = thread_safe;
}
- this->plt_thread_safe_ = thread_safe;
- if (parameters->options().output_is_position_independent())
- this->rela_dyn_size_
- = this->rela_dyn_section(layout)->current_data_size();
+ if (size == 64
+ && parameters->options().output_is_position_independent())
+ {
+ gold_assert (this->rela_dyn_);
+ this->rela_dyn_size_ = this->rela_dyn_->current_data_size();
+ }
this->stub_group_size_ = parameters->options().stub_group_size();
bool no_size_errors = true;

View File

@ -0,0 +1,66 @@
Only in binutils-2.34/gold: autom4te.cache
diff -rup binutils.orig/gold/configure binutils-2.34/gold/configure
--- binutils.orig/gold/configure 2020-04-20 12:35:13.048297305 +0100
+++ binutils-2.34/gold/configure 2020-04-20 14:02:06.743725696 +0100
@@ -5180,7 +5180,8 @@ for targ in $target $canon_targets; do
. ${srcdir}/configure.tgt
if test "$targ_obj" = "UNKNOWN"; then
- as_fn_error $? "\"unsupported target $targ\"" "$LINENO" 5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"unsupported target $targ\"" >&5
+$as_echo "$as_me: WARNING: \"unsupported target $targ\"" >&2;}
else
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
if test "$targ_extra_obj" != ""; then
diff -rup binutils.orig/gold/configure.ac binutils-2.34/gold/configure.ac
--- binutils.orig/gold/configure.ac 2020-04-20 12:35:13.050297291 +0100
+++ binutils-2.34/gold/configure.ac 2020-04-20 14:01:46.435868770 +0100
@@ -181,7 +181,7 @@ for targ in $target $canon_targets; do
. ${srcdir}/configure.tgt
if test "$targ_obj" = "UNKNOWN"; then
- AC_MSG_ERROR("unsupported target $targ")
+ AC_MSG_WARN("unsupported target $targ")
else
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
if test "$targ_extra_obj" != ""; then
--- binutils.orig/ld/configure.tgt 2020-04-20 12:35:12.465301359 +0100
+++ binutils-2.34/ld/configure.tgt 2020-04-20 14:17:52.123066333 +0100
@@ -220,7 +220,7 @@ bfin-*-linux-uclibc*) targ_emul=elf32bfi
targ_extra_emuls="elf32bfin"
targ_extra_libpath=$targ_extra_emuls
;;
-bpf-*-*) targ_emul=elf64bpf
+bpf-* | bpf-*-*) targ_emul=elf64bpf
;;
cr16-*-elf*) targ_emul=elf32cr16
;;
@@ -1026,7 +1026,7 @@ z8k-*-coff) targ_emul=z8002
targ_extra_ofiles=
;;
*)
- echo 2>&1 "*** ld does not support target ${targ}"
+ echo 2>&1 "*** ld does not support target '${targ}' NO REALLY"
echo 2>&1 "*** see ld/configure.tgt for supported targets"
exit 1
--- binutils.orig/bfd/config.bfd 2020-04-20 12:35:13.038297375 +0100
+++ binutils-2.34/bfd/config.bfd 2020-04-20 14:25:26.452869193 +0100
@@ -473,7 +473,7 @@ case "${targ}" in
;;
#ifdef BFD64
- bpf-*-none)
+ bpf-*-none | bpf-*)
targ_defvec=bpf_elf64_le_vec
targ_selvecs=bpf_elf64_be_vec
targ_underscore=yes
@@ -1427,7 +1427,7 @@ case "${targ}" in
;;
*)
- echo 1>&2 "*** BFD does not support target ${targ}."
+ echo 1>&2 "*** BFD does not support target '${targ}'. Honest."
echo 1>&2 "*** Look in bfd/config.bfd for supported targets."
exit 1
;;

View File

@ -0,0 +1,29 @@
--- binutils.orig/bfd/elf.c 2023-10-13 11:38:25.159530287 +0100
+++ binutils-2.41/bfd/elf.c 2023-10-13 11:41:23.290898228 +0100
@@ -9479,6 +9479,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd
if (elf_use_dt_symtab_p (abfd))
iverneed->vn_filename
= elf_tdata (abfd)->dt_strtab + iverneed->vn_file;
+ else if (hdr == NULL)
+ goto error_return_bad_verref;
else
iverneed->vn_filename
= bfd_elf_string_from_elf_section (abfd, hdr->sh_link,
@@ -9516,6 +9518,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd
if (elf_use_dt_symtab_p (abfd))
ivernaux->vna_nodename
= elf_tdata (abfd)->dt_strtab + ivernaux->vna_name;
+ else if (hdr == NULL)
+ goto error_return_bad_verref;
else
ivernaux->vna_nodename
= bfd_elf_string_from_elf_section (abfd, hdr->sh_link,
@@ -9546,7 +9550,7 @@ _bfd_elf_slurp_version_tables (bfd *abfd
iverneed->vn_nextref = NULL;
if (iverneed->vn_next == 0)
break;
- if (i + 1 < hdr->sh_info)
+ if (hdr != NULL && (i + 1 < hdr->sh_info))
iverneed->vn_nextref = iverneed + 1;
if (iverneed->vn_next

View File

@ -0,0 +1,236 @@
diff -rcp ../binutils-2.20.51.0.7.original/bfd/configure ./bfd/configure
--- a/bfd/configure 2010-04-08 14:53:48.000000000 +0100
+++ b/bfd/configure 2010-04-08 14:56:50.000000000 +0100
@@ -10762,10 +10762,34 @@
# before this can be enabled.
hardcode_into_libs=yes
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390*|powerpc*|ppc*|sparc*)
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ fi
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
diff -rcp ../binutils-2.20.51.0.7.original/binutils/configure ./binutils/configure
--- a/binutils/configure 2010-04-08 14:53:45.000000000 +0100
+++ b/binutils/configure 2010-04-08 14:56:21.000000000 +0100
@@ -10560,10 +10560,34 @@
# before this can be enabled.
hardcode_into_libs=yes
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390*|powerpc*|ppc*|sparc*)
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ fi
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
diff -rcp ../binutils-2.20.51.0.7.original/gas/configure ./gas/configure
--- a/gas/configure 2010-04-08 14:53:47.000000000 +0100
+++ b/gas/configure 2010-04-08 14:57:24.000000000 +0100
@@ -10547,10 +10547,34 @@
# before this can be enabled.
hardcode_into_libs=yes
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390*|powerpc*|ppc*|sparc*)
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ fi
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
diff -rcp ../binutils-2.20.51.0.7.original/gprof/configure ./gprof/configure
--- a/gprof/configure 2010-04-08 14:53:45.000000000 +0100
+++ b/gprof/configure 2010-04-08 14:57:50.000000000 +0100
@@ -10485,10 +10485,34 @@
# before this can be enabled.
hardcode_into_libs=yes
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390*|powerpc*|ppc*|sparc*)
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ fi
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
diff -rcp ../binutils-2.20.51.0.7.original/ld/configure ./ld/configure
--- a/ld/configure 2010-04-08 14:53:44.000000000 +0100
+++ b/ld/configure 2010-04-08 14:58:21.000000000 +0100
@@ -10966,10 +10966,34 @@
# before this can be enabled.
hardcode_into_libs=yes
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390*|powerpc*|ppc*|sparc*)
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ fi
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
Only in .: .#libtool.m4
Only in .: #libtool.m4#
diff -rcp ../binutils-2.20.51.0.7.original/opcodes/configure ./opcodes/configure
--- a/opcodes/configure 2010-04-08 14:53:45.000000000 +0100
+++ b/opcodes/configure 2010-04-08 14:59:10.000000000 +0100
@@ -10496,10 +10496,34 @@
# before this can be enabled.
hardcode_into_libs=yes
+ # find out which ABI we are using
+ libsuff=
+ case "$host_cpu" in
+ x86_64*|s390*|powerpc*|ppc*|sparc*)
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *64-bit*)
+ libsuff=64
+ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ fi
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on

View File

@ -0,0 +1,28 @@
diff -rup binutils.orig/ltmain.sh binutils-2.37/ltmain.sh
--- binutils.orig/ltmain.sh 2022-01-27 16:23:09.304207432 +0000
+++ binutils-2.37/ltmain.sh 2022-01-27 16:23:18.380143759 +0000
@@ -7103,6 +7103,7 @@ EOF
rpath="$finalize_rpath"
test "$mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
@@ -7798,6 +7799,7 @@ EOF
rpath=
hardcode_libdirs=
for libdir in $compile_rpath $finalize_rpath; do
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
@@ -7849,6 +7851,7 @@ EOF
rpath=
hardcode_libdirs=
for libdir in $finalize_rpath; do
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
Only in binutils-2.37: ltmain.sh.orig

View File

@ -0,0 +1,49 @@
diff -rupN binutils.orig/multilib.am binutils-2.41/multilib.am
--- binutils.orig/multilib.am 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.41/multilib.am 2024-02-12 16:41:56.899838085 +0000
@@ -0,0 +1,45 @@
+## automake - create Makefile.in from Makefile.am
+
+## Copyright (C) 1994-2017 Free Software Foundation, Inc.
+## This Makefile.in is free software; the Free Software Foundation
+## gives unlimited permission to copy and/or distribute it,
+## with or without modifications, as long as this notice is preserved.
+
+## 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.
+
+MULTISRCTOP =
+MULTIBUILDTOP =
+MULTIDIRS =
+MULTISUBDIR =
+MULTIDO = true
+MULTICLEAN = true
+
+# GNU Make needs to see an explicit $(MAKE) variable in the command it
+# runs to enable its job server during parallel builds. Hence the
+# comments below.
+all-multi:
+ $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
+install-multi:
+ $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
+mostlyclean-multi:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
+clean-multi:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
+distclean-multi:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
+maintainer-clean-multi:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
+
+.MAKE .PHONY: all-multi clean-multi distclean-multi install-am \
+ install-multi maintainer-clean-multi mostlyclean-multi
+
+install-exec-local: install-multi
+
+all-local: all-multi
+mostlyclean-local: mostlyclean-multi
+clean-local: clean-multi
+distclean-local: distclean-multi
+maintainer-clean-local: maintainer-clean-multi

View File

@ -0,0 +1,28 @@
--- a/bfd/bfd-in.h 2012-08-02 10:56:34.561769686 +0100
+++ b/bfd/bfd-in.h 2012-08-02 11:13:27.134797755 +0100
@@ -25,11 +25,6 @@
#ifndef __BFD_H_SEEN__
#define __BFD_H_SEEN__
-/* PR 14072: Ensure that config.h is included first. */
-#if !defined PACKAGE && !defined PACKAGE_VERSION
-#error config.h must be included before this header
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
--- a/bfd/bfd-in2.h 2012-08-02 10:56:34.349769680 +0100
+++ b/bfd/bfd-in2.h 2012-08-02 11:13:40.015798113 +0100
@@ -32,11 +32,6 @@
#ifndef __BFD_H_SEEN__
#define __BFD_H_SEEN__
-/* PR 14072: Ensure that config.h is included first. */
-#if !defined PACKAGE && !defined PACKAGE_VERSION
-#error config.h must be included before this header
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -0,0 +1,83 @@
diff -rup binutils,orig/binutils/doc/binutils.texi binutils-2.41/binutils/doc/binutils.texi
--- binutils,orig/binutils/doc/binutils.texi 2024-02-12 10:03:46.609677213 +0000
+++ binutils-2.41/binutils/doc/binutils.texi 2024-02-12 10:03:55.976681219 +0000
@@ -2651,11 +2651,12 @@ rather than @code{li}. All of the @opti
@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}, @option{vle}, and @option{future}.
+@option{power8}, @option{power9}, @option{power10}, @option{power11},
+@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{pwr11}, @option{pwrx}, @option{titan}, @option{vle},
+and @option{future}.
@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{lsp}, @option{htm},
Only in binutils-2.41/binutils/doc: binutils.texi.orig
diff -rup binutils,orig/gas/config/tc-ppc.c binutils-2.41/gas/config/tc-ppc.c
--- binutils,orig/gas/config/tc-ppc.c 2024-02-12 10:03:46.742677270 +0000
+++ binutils-2.41/gas/config/tc-ppc.c 2024-02-12 10:03:55.977681219 +0000
@@ -1392,6 +1392,8 @@ PowerPC options:\n"));
fprintf (stream, _("\
-mpower10, -mpwr10 generate code for Power10 architecture\n"));
fprintf (stream, _("\
+-mpower11, -mpwr11 generate code for Power11 architecture\n"));
+ fprintf (stream, _("\
-mlibresoc generate code for Libre-SOC architecture\n"));
fprintf (stream, _("\
-mfuture generate code for 'future' architecture\n"));
diff -rup binutils,orig/gas/doc/c-ppc.texi binutils-2.41/gas/doc/c-ppc.texi
--- binutils,orig/gas/doc/c-ppc.texi 2024-02-12 10:03:46.783677288 +0000
+++ binutils-2.41/gas/doc/c-ppc.texi 2024-02-12 10:03:55.977681219 +0000
@@ -156,6 +156,9 @@ Generate code for Power9 architecture.
@item -mpower10, -mpwr10
Generate code for Power10 architecture.
+@item -mpower11, -mpwr11
+Generate code for Power11 architecture.
+
@item -mfuture
Generate code for 'future' architecture.
diff -rup binutils,orig/opcodes/ppc-dis.c binutils-2.41/opcodes/ppc-dis.c
--- binutils,orig/opcodes/ppc-dis.c 2024-02-12 10:03:47.836677739 +0000
+++ binutils-2.41/opcodes/ppc-dis.c 2024-02-12 10:03:55.977681219 +0000
@@ -208,6 +208,11 @@ struct ppc_mopt ppc_opts[] = {
| PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
| PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
0 },
+ { "power11", (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
+ | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
+ | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
+ | PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
+ 0 },
{ "libresoc",(PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
| PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
| PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
@@ -267,6 +272,11 @@ struct ppc_mopt ppc_opts[] = {
| PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
| PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
0 },
+ { "pwr11", (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64
+ | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
+ | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9
+ | PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX),
+ 0 },
{ "pwrx", PPC_OPCODE_POWER | PPC_OPCODE_POWER2,
0 },
{ "raw", PPC_OPCODE_PPC,
@@ -396,7 +406,7 @@ powerpc_init_dialect (struct disassemble
break;
default:
if (info->arch == bfd_arch_powerpc)
- dialect = ppc_parse_cpu (dialect, &sticky, "power10") | PPC_OPCODE_ANY;
+ dialect = ppc_parse_cpu (dialect, &sticky, "power11") | PPC_OPCODE_ANY;
else
dialect = ppc_parse_cpu (dialect, &sticky, "pwr");
break;

View File

@ -0,0 +1,114 @@
--- binutils.orig/bfd/elf64-ppc.c 2024-01-16 10:39:26.903071936 +0000
+++ binutils-2.41/bfd/elf64-ppc.c 2024-01-16 10:39:38.650127903 +0000
@@ -4749,6 +4749,21 @@ is_8byte_reloc (enum elf_ppc64_reloc_typ
|| r_type == R_PPC64_PLTCALL);
}
+/* The RELR encoding doesn't allow odd addresses, so RELR_ALIGN must
+ be at least 1. R_PPC64_RELATIVE relocs require alignment of 2**3.
+ We use 3 here to avoid complexity in relocate_section. PR30824. */
+#define RELR_ALIGN 3
+
+static bool
+maybe_relr (enum elf_ppc64_reloc_type r_type,
+ const Elf_Internal_Rela *rel,
+ const asection *sec)
+{
+ return ((r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC)
+ && (rel->r_offset & ((1 << RELR_ALIGN) - 1)) == 0
+ && sec->alignment_power >= RELR_ALIGN);
+}
+
/* Like bfd_reloc_offset_in_range but without a howto. Return true
iff a field of SIZE bytes at OFFSET is within SEC limits. */
@@ -5401,9 +5416,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc
p->count += 1;
if (!must_be_dyn_reloc (info, r_type))
p->pc_count += 1;
- if ((r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC)
- && rel->r_offset % 2 == 0
- && sec->alignment_power != 0)
+ if (maybe_relr (r_type, rel, sec))
p->rel_count += 1;
}
else
@@ -5438,9 +5451,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc
p->ifunc = is_ifunc;
}
p->count += 1;
- if ((r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC)
- && rel->r_offset % 2 == 0
- && sec->alignment_power != 0)
+ if (maybe_relr (r_type, rel, sec))
p->rel_count += 1;
}
}
@@ -7291,9 +7302,7 @@ dec_dynrel_count (const Elf_Internal_Rel
{
if (!must_be_dyn_reloc (info, r_type))
p->pc_count -= 1;
- if ((r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC)
- && rel->r_offset % 2 == 0
- && sec->alignment_power != 0)
+ if (maybe_relr (r_type, rel, sec))
p->rel_count -= 1;
p->count -= 1;
if (p->count == 0)
@@ -7326,9 +7335,7 @@ dec_dynrel_count (const Elf_Internal_Rel
{
if (p->sec == sec && p->ifunc == is_ifunc)
{
- if ((r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC)
- && rel->r_offset % 2 == 0
- && sec->alignment_power != 0)
+ if (maybe_relr (r_type, rel, sec))
p->rel_count -= 1;
p->count -= 1;
if (p->count == 0)
@@ -13869,6 +13876,9 @@ ppc64_elf_size_stubs (struct bfd_link_in
switch (r_type)
{
default:
+ if (info->enable_dt_relr
+ && maybe_relr (r_type, irela, section))
+ break;
continue;
case R_PPC64_REL24:
@@ -13880,14 +13890,6 @@ ppc64_elf_size_stubs (struct bfd_link_in
if ((section->flags & SEC_CODE) != 0)
break;
continue;
-
- case R_PPC64_ADDR64:
- case R_PPC64_TOC:
- if (info->enable_dt_relr
- && irela->r_offset % 2 == 0
- && section->alignment_power != 0)
- break;
- continue;
}
/* Now determine the call target, its name, value,
@@ -15272,7 +15274,7 @@ ppc64_elf_build_stubs (struct bfd_link_i
while (i < htab->relr_count)
{
bfd_vma base = relr_addr[i];
- BFD_ASSERT (base % 2 == 0);
+ BFD_ASSERT ((base & ((1 << RELR_ALIGN) - 1)) == 0);
bfd_put_64 (htab->elf.dynobj, base, loc);
loc += 8;
i++;
@@ -17510,9 +17512,8 @@ ppc64_elf_relocate_section (bfd *output_
if (!(info->enable_dt_relr
&& ELF64_R_TYPE (outrel.r_info) == R_PPC64_RELATIVE
- && rel->r_offset % 2 == 0
- && input_section->alignment_power != 0
- && ELF64_R_TYPE (orig_rel.r_info) != R_PPC64_UADDR64))
+ && maybe_relr (ELF64_R_TYPE (orig_rel.r_info),
+ rel, input_section)))
{
sreloc = elf_section_data (input_section)->sreloc;
if (h != NULL

View File

@ -0,0 +1,167 @@
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.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/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

View File

@ -0,0 +1,239 @@
diff -rupN binutils.orig/bfd/elfnn-riscv.c binutils-2.41/bfd/elfnn-riscv.c
--- binutils.orig/bfd/elfnn-riscv.c 2024-01-02 17:35:07.412218130 +0000
+++ binutils-2.41/bfd/elfnn-riscv.c 2024-01-02 17:36:52.274311071 +0000
@@ -1737,7 +1737,10 @@ perform_relocation (const reloc_howto_ty
{
if (howto->pc_relative)
value -= sec_addr (input_section) + rel->r_offset;
- value += rel->r_addend;
+
+ /* PR31179, ignore the non-zero addend of R_RISCV_SUB_ULEB128. */
+ if (ELFNN_R_TYPE (rel->r_info) != R_RISCV_SUB_ULEB128)
+ value += rel->r_addend;
switch (ELFNN_R_TYPE (rel->r_info))
{
@@ -1818,10 +1821,7 @@ perform_relocation (const reloc_howto_ty
value = ENCODE_CITYPE_LUI_IMM (RISCV_CONST_HIGH_PART (value));
break;
- /* SUB_ULEB128 must be applied after SET_ULEB128, so we only write the
- value back for SUB_ULEB128 should be enough. */
- case R_RISCV_SET_ULEB128:
- break;
+ /* R_RISCV_SET_ULEB128 won't go into here. */
case R_RISCV_SUB_ULEB128:
{
unsigned int len = 0;
@@ -2514,7 +2514,7 @@ riscv_elf_relocate_section (bfd *output_
else
{
msg = ("Mismatched R_RISCV_SET_ULEB128, it must be paired with"
- "and applied before R_RISCV_SUB_ULEB128");
+ " and applied before R_RISCV_SUB_ULEB128");
r = bfd_reloc_dangerous;
}
break;
@@ -2523,14 +2523,40 @@ riscv_elf_relocate_section (bfd *output_
if (uleb128_set_rel != NULL
&& uleb128_set_rel->r_offset == rel->r_offset)
{
- relocation = uleb128_set_vma - relocation;
+ relocation = uleb128_set_vma - relocation
+ + uleb128_set_rel->r_addend;
uleb128_set_vma = 0;
uleb128_set_rel = NULL;
+
+ /* PR31179, the addend of SUB_ULEB128 should be zero if using
+ .uleb128, but we make it non-zero by accident in assembler,
+ so just ignore it in perform_relocation, and make assembler
+ continue doing the right thing. Don't reset the addend of
+ SUB_ULEB128 to zero here since it will break the --emit-reloc,
+ even though the non-zero addend is unexpected.
+
+ We encourage people to rebuild their stuff to get the
+ non-zero addend of SUB_ULEB128, but that might need some
+ times, so report warnings to inform people need to rebuild
+ if --check-uleb128 is enabled. However, since the failed
+ .reloc cases for ADD/SET/SUB/ULEB128 are rarely to use, it
+ may acceptable that stop supproting them until people rebuld
+ their stuff, maybe half-year or one year later. I believe
+ this might be the least harmful option that we should go.
+
+ Or maybe we should teach people that don't write the
+ .reloc R_RISCV_SUB* with non-zero constant, and report
+ warnings/errors in assembler. */
+ if (htab->params->check_uleb128
+ && rel->r_addend != 0)
+ _bfd_error_handler (_("%pB: warning: R_RISCV_SUB_ULEB128 with"
+ " non-zero addend, please rebuild by"
+ " Fedora 40 binutils or up"), input_bfd);
}
else
{
msg = ("Mismatched R_RISCV_SUB_ULEB128, it must be paired with"
- "and applied after R_RISCV_SET_ULEB128");
+ " and applied after R_RISCV_SET_ULEB128");
r = bfd_reloc_dangerous;
}
break;
@@ -5123,7 +5149,13 @@ _bfd_riscv_relax_section (bfd *abfd, ase
if (h != NULL && h->type == STT_GNU_IFUNC)
continue;
+ /* Maybe we should check UNDEFWEAK_NO_DYNAMIC_RELOC here? But that
+ will break the undefweak relaxation testcases, so just make sure
+ we won't do relaxations for linker_def symbols in short-term. */
if (h->root.type == bfd_link_hash_undefweak
+ /* The linker_def symbol like __ehdr_start that may be undefweak
+ for now, but will be guaranteed to be defined later. */
+ && !h->root.linker_def
&& (relax_func == _bfd_riscv_relax_lui
|| relax_func == _bfd_riscv_relax_pc))
{
diff -rupN binutils.orig/bfd/elfxx-riscv.h binutils-2.41/bfd/elfxx-riscv.h
--- binutils.orig/bfd/elfxx-riscv.h 2024-01-02 17:35:07.412218130 +0000
+++ binutils-2.41/bfd/elfxx-riscv.h 2024-01-02 17:35:24.252233056 +0000
@@ -31,6 +31,8 @@ struct riscv_elf_params
{
/* Whether to relax code sequences to GP-relative addressing. */
bool relax_gp;
+ /* Whether to check if SUB_ULEB128 relocation has non-zero addend. */
+ bool check_uleb128;
};
extern void riscv_elf32_set_options (struct bfd_link_info *,
diff -rupN binutils.orig/ld/NEWS binutils-2.41/ld/NEWS
--- binutils.orig/ld/NEWS 2024-01-02 17:35:08.012218662 +0000
+++ binutils-2.41/ld/NEWS 2024-01-02 17:35:56.139261318 +0000
@@ -1,5 +1,10 @@
-*- text -*-
+* On RISC-V, add ld target option --[no-]check-uleb128. Should rebuild the
+ objects by binutils 2.42 and up if enabling the option and get warnings,
+ since the non-zero addend of SUB_ULEB128 shouldn't be generated from .uleb128
+ directives.
+
* Added --warn-execstack-objects to warn about executable stacks only when an
input object file requests one. Also added --error-execstack and
--error-rxw-segments options to convert warnings about executable stacks and
diff -rupN binutils.orig/ld/emultempl/riscvelf.em binutils-2.41/ld/emultempl/riscvelf.em
--- binutils.orig/ld/emultempl/riscvelf.em 2024-01-02 17:35:07.699218385 +0000
+++ binutils-2.41/ld/emultempl/riscvelf.em 2024-01-02 17:35:24.252233056 +0000
@@ -25,7 +25,8 @@ fragment <<EOF
#include "elf/riscv.h"
#include "elfxx-riscv.h"
-static struct riscv_elf_params params = { .relax_gp = 1 };
+static struct riscv_elf_params params = { .relax_gp = 1,
+ .check_uleb128 = 0};
EOF
# Define some shell vars to insert bits of code into the standard elf
@@ -35,17 +36,23 @@ enum risccv_opt
{
OPTION_RELAX_GP = 321,
OPTION_NO_RELAX_GP,
+ OPTION_CHECK_ULEB128,
+ OPTION_NO_CHECK_ULEB128,
};
'
PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST_LONGOPTS}'
{ "relax-gp", no_argument, NULL, OPTION_RELAX_GP },
{ "no-relax-gp", no_argument, NULL, OPTION_NO_RELAX_GP },
+ { "check-uleb128", no_argument, NULL, OPTION_CHECK_ULEB128 },
+ { "no-check-uleb128", no_argument, NULL, OPTION_NO_CHECK_ULEB128 },
'
PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_OPTIONS}'
fprintf (file, _(" --relax-gp Perform GP relaxation\n"));
fprintf (file, _(" --no-relax-gp Don'\''t perform GP relaxation\n"));
+ fprintf (file, _(" --check-uleb128 Check if SUB_ULEB128 has non-zero addend\n"));
+ fprintf (file, _(" --no-check-uleb128 Don'\''t check if SUB_ULEB128 has non-zero addend\n"));
'
PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
@@ -56,6 +63,14 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LI
case OPTION_NO_RELAX_GP:
params.relax_gp = 0;
break;
+
+ case OPTION_CHECK_ULEB128:
+ params.check_uleb128 = 1;
+ break;
+
+ case OPTION_NO_CHECK_ULEB128:
+ params.check_uleb128 = 0;
+ break;
'
fragment <<EOF
diff -rupN binutils.orig/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp binutils-2.41/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
--- binutils.orig/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp 2024-01-02 17:35:07.942218600 +0000
+++ binutils-2.41/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp 2024-01-02 17:35:24.252233056 +0000
@@ -173,6 +173,8 @@ if [istarget "riscv*-*-*"] {
run_dump_test "attr-phdr"
run_dump_test "relax-max-align-gp"
run_dump_test "uleb128"
+ run_dump_test "pr31179"
+ run_dump_test "pr31179-r"
run_ld_link_tests [list \
[list "Weak reference 32" "-T weakref.ld -m[riscv_choose_ilp32_emul]" "" \
"-march=rv32i -mabi=ilp32" {weakref32.s} \
diff -rupN binutils.orig/ld/testsuite/ld-riscv-elf/pr31179-r.d binutils-2.41/ld/testsuite/ld-riscv-elf/pr31179-r.d
--- binutils.orig/ld/testsuite/ld-riscv-elf/pr31179-r.d 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.41/ld/testsuite/ld-riscv-elf/pr31179-r.d 2024-01-02 17:35:24.252233056 +0000
@@ -0,0 +1,10 @@
+#source: pr31179.s
+#as:
+#readelf: -Wr
+
+Relocation section '.rela.text' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_RISCV_SET_ULEB128[ ]+[0-9a-f]+[ ]+bar \+ 1
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_RISCV_SUB_ULEB128[ ]+[0-9a-f]+[ ]+foo \+ 0
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_RISCV_SET_ULEB128[ ]+[0-9a-f]+[ ]+bar \+ 1
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_RISCV_SUB_ULEB128[ ]+[0-9a-f]+[ ]+foo \+ 1
diff -rupN binutils.orig/ld/testsuite/ld-riscv-elf/pr31179.d binutils-2.41/ld/testsuite/ld-riscv-elf/pr31179.d
--- binutils.orig/ld/testsuite/ld-riscv-elf/pr31179.d 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.41/ld/testsuite/ld-riscv-elf/pr31179.d 2024-01-02 17:35:24.252233056 +0000
@@ -0,0 +1,11 @@
+#source: pr31179.s
+#as:
+#ld: --check-uleb128
+#objdump: -sj .text
+#warning: .*R_RISCV_SUB_ULEB128 with non-zero addend, please rebuild by Fedora 40 binutils or up
+
+.*:[ ]+file format .*
+
+Contents of section .text:
+
+[ ]+[0-9a-f]+[ ]+00000303[ ]+.*
diff -rupN binutils.orig/ld/testsuite/ld-riscv-elf/pr31179.s binutils-2.41/ld/testsuite/ld-riscv-elf/pr31179.s
--- binutils.orig/ld/testsuite/ld-riscv-elf/pr31179.s 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.41/ld/testsuite/ld-riscv-elf/pr31179.s 2024-01-02 17:35:24.252233056 +0000
@@ -0,0 +1,13 @@
+.globl _start
+_start:
+
+foo:
+.2byte 0
+bar:
+
+.uleb128 bar - foo + 1
+
+reloc:
+.reloc reloc, R_RISCV_SET_ULEB128, bar + 1
+.reloc reloc, R_RISCV_SUB_ULEB128, foo + 1
+.byte 0x0
--- binutils.orig/gas/config/tc-riscv.c 2024-01-03 13:08:16.588286420 +0000
+++ binutils-2.41/gas/config/tc-riscv.c 2024-01-03 13:08:32.749297812 +0000
@@ -4949,6 +4949,7 @@ riscv_insert_uleb128_fixes (bfd *abfd AT
fix_new_exp (fragP, fragP->fr_fix, 0,
exp_dup, 0, BFD_RELOC_RISCV_SET_ULEB128);
exp_dup->X_add_symbol = exp->X_op_symbol;
+ exp_dup->X_add_number = 0; /* Set addend of SUB_ULEB128 to zero. */
fix_new_exp (fragP, fragP->fr_fix, 0,
exp_dup, 0, BFD_RELOC_RISCV_SUB_ULEB128);
}

View File

@ -0,0 +1,136 @@
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d
--- binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:11:38.656875289 +0000
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:49:26.786573665 +0000
@@ -12,8 +12,8 @@ Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
RISCV_ATTRIBUT .*
LOAD .*
-
+#...
Section to Segment mapping:
Segment Sections...
00 .riscv.attributes
- 01 .text
+#pass
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:11:38.659875285 +0000
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:42:54.803431287 +0000
@@ -8,7 +8,7 @@
Disassembly of section \.text:
0+[0-9a-f]+ <_start>:
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,[0-9]+
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:11:38.659875285 +0000
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:43:49.540306593 +0000
@@ -11,5 +11,5 @@ Disassembly of section .text:
[0-9a-f]+ <_start>:
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1.*
.*:[ ]+[0-9a-f]+[ ]+addi?[ ]+a0,gp.*<data_a>
-.*:[ ]+[0-9a-f]+[ ]+addi?[ ]+a1,a1.*<data_b>
+.*:[ ]+[0-9a-f]+[ ]+mv[ ]+a1,a1
#pass
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:11:38.659875285 +0000
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:46:55.570899994 +0000
@@ -2,4 +2,5 @@
#source: pcrel-lo-addend-2a.s
#as: -march=rv32ic
#ld: -m[riscv_choose_ilp32_emul] --no-relax
+#skip: *-*-*
#error: .*dangerous relocation: %pcrel_lo overflow with an addend, the value of %pcrel_hi is 0x1000 without any addend, but may be 0x2000 after adding the %pcrel_lo addend
diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf.exp binutils-2.40/ld/testsuite/ld-elf/dwarf.exp
--- binutils.orig/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 10:11:38.515875516 +0000
+++ binutils-2.40/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 11:08:52.209377332 +0000
@@ -29,6 +29,10 @@ if ![is_elf_format] {
return
}
+if { [istarget riscv*-*-*] } then {
+ return
+}
+
# Skip targets where -shared is not supported
if ![check_shared_lib_support] {
diff -rup binutils.orig/ld/testsuite/ld-elf/tls.exp binutils-2.40/ld/testsuite/ld-elf/tls.exp
--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2023-02-16 10:11:38.540875476 +0000
+++ binutils-2.40/ld/testsuite/ld-elf/tls.exp 2023-02-16 11:08:56.944369374 +0000
@@ -28,6 +28,10 @@ if { !([istarget *-*-linux*]
return
}
+if { [istarget riscv*-*-*] } then {
+ return
+}
+
# Check to see if the C compiler works.
if { ![check_compiler_available] } {
return
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2023-08-24 07:48:30.429195480 +0100
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp 2023-08-24 07:57:05.535302711 +0100
@@ -1409,6 +1409,8 @@ proc objcopy_test_without_global_symbol
# The AArch64 and ARM targets preserve mapping symbols
# in object files, so they will fail this test.
setup_xfail aarch64*-*-* arm*-*-*
+# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
+setup_xfail riscv*-*-*
objcopy_test_without_global_symbol
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2023-08-24 07:48:31.808196076 +0100
+++ binutils-2.41/ld/testsuite/ld-plugin/plugin.exp 2023-08-24 07:59:30.285716568 +0100
@@ -132,6 +132,10 @@ if [is_pecoff_format] {
append libs " --image-base=0x10000000"
}
+if { [istarget riscv*-*-*] } then {
+ return
+}
+
set plugin_tests [list \
[list "load plugin" "-plugin $plugin_path \
$testobjfiles $libs" "" "" "" {{ld plugin-1.d}} "main.x" ] \
--- binutils.orig/binutils/testsuite/binutils-all/compress.exp 2023-12-11 10:09:16.923374463 +0000
+++ binutils-2.41/binutils/testsuite/binutils-all/compress.exp 2023-12-12 09:00:15.150036675 +0000
@@ -818,6 +818,10 @@ proc test_gnu_debuglink {} {
}
}
+if { [istarget riscv*-*-*] } then {
+ return
+}
+
if {[is_elf_format]} then {
test_gnu_debuglink
}
--- binutils-2.41/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2023-07-03 00:00:00.000000000 +0100
+++ binutils.new/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2023-12-12 11:52:54.564057931 +0000
@@ -8,10 +8,10 @@
Disassembly of section \.text:
0+[0-9a-f]+ <_start>:
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,[0-9]+
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1,0x[0-9a-f]+
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,[0-9]+ # [0-9a-f]+ <data_g>
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,\-[0-9]+ # [0-9a-f]+ <data_g>
.*:[ ]+[0-9a-f]+[ ]+lui[ ]+a2,0x[0-9a-f]+
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,a2,[0-9]+ # [0-9a-f]+ <data_g>
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a3,tp,0 # 0 <data_t>
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2023-12-12 14:21:10.225342926 +0000
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp 2023-12-12 14:22:12.453421499 +0000
@@ -1410,7 +1410,7 @@ proc objcopy_test_without_global_symbol
# in object files, so they will fail this test.
setup_xfail aarch64*-*-* arm*-*-*
# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
-setup_xfail riscv*-*-*
+# setup_xfail riscv*-*-*
objcopy_test_without_global_symbol

View File

@ -0,0 +1,52 @@
diff -rup binutils.orig/binutils/testsuite/binutils-all/compress.exp binutils-2.41/binutils/testsuite/binutils-all/compress.exp
--- binutils.orig/binutils/testsuite/binutils-all/compress.exp 2024-04-30 15:04:40.935567791 +0100
+++ binutils-2.41/binutils/testsuite/binutils-all/compress.exp 2024-04-30 15:10:31.703681471 +0100
@@ -139,6 +139,10 @@ if ![string match "" $got] then {
}
}
+if { [istarget "s390x-*-*"] } {
+ return
+}
+
# Xfail this test if there are no compressed sections.
setup_xfail "$compression_used$target_triplet"
set testname "objcopy compress debug sections in archive with zlib-gnu"
diff -rup binutils.orig/ld/testsuite/ld-elf/indirect.exp binutils-2.41/ld/testsuite/ld-elf/indirect.exp
--- binutils.orig/ld/testsuite/ld-elf/indirect.exp 2024-04-30 15:04:42.275572059 +0100
+++ binutils-2.41/ld/testsuite/ld-elf/indirect.exp 2024-04-30 15:15:19.760991281 +0100
@@ -135,6 +135,10 @@ set testname "Indirect symbol 2"
set cmd "$ld -shared -o tmpdir/indirect2.so tmpdir/indirect2.o"
check_link_message "$cmd" [list $string2] "$testname"
+if { [istarget "s390x-*-*"] } {
+ return
+}
+
set run_tests [list \
[list "Run with libindirect3c.so 1" \
"-Wl,--no-as-needed tmpdir/indirect3a.o tmpdir/indirect3b.o tmpdir/libindirect3c.so" "" \
diff -rup binutils.orig/ld/testsuite/ld-shared/shared.exp binutils-2.41/ld/testsuite/ld-shared/shared.exp
--- binutils.orig/ld/testsuite/ld-shared/shared.exp 2024-04-30 15:04:42.436572571 +0100
+++ binutils-2.41/ld/testsuite/ld-shared/shared.exp 2024-04-30 15:16:21.522057698 +0100
@@ -267,7 +267,7 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG
setup_xfail "x86_64-*-linux*"
}
setup_xfail "x86_64-*-linux-gnux32"
- setup_xfail "s390x-*-linux*"
+ # setup_xfail "s390x-*-linux*"
if [ string match $shared_needs_pic "yes" ] {
setup_xfail "arm*-*-linux*"
}
diff -rup binutils.orig/ld/testsuite/ld-vsb/vsb.exp binutils-2.41/ld/testsuite/ld-vsb/vsb.exp
--- binutils.orig/ld/testsuite/ld-vsb/vsb.exp 2024-04-30 15:04:42.454572629 +0100
+++ binutils-2.41/ld/testsuite/ld-vsb/vsb.exp 2024-04-30 15:17:37.850139781 +0100
@@ -366,7 +366,7 @@ proc visibility_run {visibility} {
|| [ string match $visibility "protected_weak" ]
|| [ string match $visibility "normal" ] } {
setup_xfail "powerpc-*-linux*"
- setup_xfail "s390x-*-linux*"
+ # setup_xfail "s390x-*-linux*"
if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } {
setup_xfail "sparc*-*-linux*"
}

View File

@ -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

View File

@ -0,0 +1,13 @@
--- binutils.orig/ld/testsuite/ld-elf/linux-x86.exp 2024-01-24 11:52:35.288014542 +0000
+++ binutils-2.41/ld/testsuite/ld-elf/linux-x86.exp 2024-01-24 17:31:39.356167357 +0000
@@ -225,6 +225,10 @@ if { [check_ifunc_attribute_available] }
# Old gcc silently ignores __attribute__ ((aligned())) with too big alignment.
proc compiler_honours_aligned { } {
global CC_FOR_TARGET READELF srcdir subdir
+
+ # Temporary fix for CentOS-10 kernel issue. (RHEL-22466)
+ return 0
+
ld_compile $CC_FOR_TARGET $srcdir/$subdir/p_align-1.c tmpdir/p_align-1.o
set output [run_host_cmd "$READELF" "-SW tmpdir/p_align-1.o"]
if { [regexp { [.]data *PROGBITS .* 8388608[\n]} $output] } {

View File

@ -0,0 +1,997 @@
--- binutils.orig/binutils/testsuite/binutils-all/addr2line.exp 2023-08-03 13:09:07.628503779 +0100
+++ binutils-2.41/binutils/testsuite/binutils-all/addr2line.exp 2023-08-03 13:18:37.138443954 +0100
@@ -39,7 +39,7 @@ if ![regexp -line "^(\[0-9a-fA-F\]+)? +\
} else {
set list [regexp -inline -all -- {\S+} $contents]
set got [binutils_run $ADDR2LINE "-e tmpdir/testprog$exe [lindex $list 0]"]
- set want "$srcdir/$subdir/testprog.c:\[0-9\]+"
+ set want "$srcdir/$subdir/.\*"
if ![regexp $want $got] then {
fail "$testname $got\n"
} else {
@@ -54,7 +54,7 @@ if ![regexp -line "^(\[0-9a-fA-F\]+)? +\
} else {
set list [regexp -inline -all -- {\S+} $contents]
set got [binutils_run $ADDR2LINE "-f -e tmpdir/testprog$exe [lindex $list 0]"]
- set want "fn\n$srcdir/$subdir/testprog.c:\[0-9\]+"
+ set want "fn\n$srcdir/$subdir/.\*"
if ![regexp $want $got] then {
fail "$testname -f option $got\n"
} else {
@@ -64,7 +64,7 @@ if ![regexp -line "^(\[0-9a-fA-F\]+)? +\
#testcase for -s option.
#Using the same fn function address used in -f option.
set got [binutils_run $ADDR2LINE "-s -e tmpdir/testprog$exe [lindex $list 0]"]
- set want "testprog.c:\[0-9\]+"
+ set want ".\*\[0-9\]+"
if ![regexp $want $got] then {
fail "$testname -s option $got\n"
} else {
--- binutils.orig/binutils/testsuite/binutils-all/objdump.exp 2023-08-03 13:09:07.631503783 +0100
+++ binutils-2.41/binutils/testsuite/binutils-all/objdump.exp 2023-08-03 14:51:54.621295727 +0100
@@ -921,7 +921,7 @@ proc test_objdump_S { } {
}
}
-test_objdump_S
+# test_objdump_S
# Test objdump --private
proc test_objdump_P {} {
--- binutils.orig/ld/testsuite/ld-scripts/ld-version.d 2023-08-03 13:09:07.949504208 +0100
+++ binutils-2.41/ld/testsuite/ld-scripts/ld-version.d 2023-08-03 15:13:01.374590134 +0100
@@ -4,4 +4,4 @@
# target: [is_elf_format]
String dump of section '.comment':
-.*GNU ld \(.*\) 2.*
+.*GNU ld .* 2.*
--- binutils.orig/ld/testsuite/ld-scripts/ld-version-2.d 2023-08-03 13:09:07.949504208 +0100
+++ binutils-2.41/ld/testsuite/ld-scripts/ld-version-2.d 2023-08-03 15:13:13.917605323 +0100
@@ -4,4 +4,4 @@
# target: [is_elf_format]
String dump of section '.comment':
-.*GNU ld \(.*\) 2.*
+.*GNU ld .* 2.*
--- binutils.orig/ld/testsuite/ld-x86-64/pr22001-1b.err 2023-08-03 13:09:07.969504235 +0100
+++ binutils-2.41/ld/testsuite/ld-x86-64/pr22001-1b.err 2023-08-03 15:22:49.743286617 +0100
@@ -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_.* against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIE
#...
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2023-08-03 13:09:07.965504230 +0100
+++ binutils-2.41/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2023-08-03 15:31:54.864037693 +0100
@@ -1,7 +1,2 @@
#...
-Disassembly of section .plt.got:
-
-[a-f0-9]+ <[_a-z]+@plt>:
-[ ]*[a-f0-9]+: f3 0f 1e fa endbr64
-[ ]*[a-f0-9]+: ff 25 .. .. 3f 00 jmp +\*0x3f....\(%rip\) # ...... <.*>
#pass
--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2023-08-03 13:09:07.975504243 +0100
+++ binutils-2.41/ld/testsuite/ld-x86-64/x86-64.exp 2023-08-03 15:46:29.537416942 +0100
@@ -1386,7 +1386,7 @@ if { [isnative] && [check_compiler_avail
"$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2b.so" \
"$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
{ protected-func-1b.c } \
- {{error_output "pr28875-func.err"}} \
+ {} \
"protected-func-2" \
] \
[list \
@@ -1402,7 +1402,7 @@ if { [isnative] && [check_compiler_avail
"$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2c.so" \
"$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
{ protected-func-1b.c } \
- {{error_output "pr28875-func.err"}} \
+ {} \
"protected-func-2a" \
] \
[list \
@@ -2155,7 +2155,6 @@ if { [isnative] && [check_compiler_avail
}
}
- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS"
undefined_weak "-fPIE" ""
undefined_weak "-fPIE" "-pie"
undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak"
--- binutils.orig/binutils/testsuite/binutils-all/addr2line.exp 2023-08-04 14:00:37.692356718 +0100
+++ binutils-2.41/binutils/testsuite/binutils-all/addr2line.exp 2023-08-04 14:04:32.627697316 +0100
@@ -39,9 +39,9 @@ if ![regexp -line "^(\[0-9a-fA-F\]+)? +\
} else {
set list [regexp -inline -all -- {\S+} $contents]
set got [binutils_run $ADDR2LINE "-e tmpdir/testprog$exe [lindex $list 0]"]
- set want "$srcdir/$subdir/.\*"
+ set want "$srcdir/.\*"
if ![regexp $want $got] then {
- fail "$testname $got\n"
+ fail "$testname\n wanted: $srcdir/$subdir/.*\n got: $got\n"
} else {
pass "$testname"
}
@@ -54,7 +54,7 @@ if ![regexp -line "^(\[0-9a-fA-F\]+)? +\
} else {
set list [regexp -inline -all -- {\S+} $contents]
set got [binutils_run $ADDR2LINE "-f -e tmpdir/testprog$exe [lindex $list 0]"]
- set want "fn\n$srcdir/$subdir/.\*"
+ set want "fn\n$srcdir/.\*"
if ![regexp $want $got] then {
fail "$testname -f option $got\n"
} else {
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2023-08-04 14:00:38.923357454 +0100
+++ binutils-2.41/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2023-08-04 14:06:45.525679653 +0100
@@ -1,2 +1,3 @@
#...
+
#pass
--- binutils.orig/binutils/testsuite/binutils-all/addr2line.exp 2023-08-04 16:05:44.678916015 +0100
+++ binutils-2.41/binutils/testsuite/binutils-all/addr2line.exp 2023-08-04 16:08:23.779024539 +0100
@@ -39,7 +39,7 @@ if ![regexp -line "^(\[0-9a-fA-F\]+)? +\
} else {
set list [regexp -inline -all -- {\S+} $contents]
set got [binutils_run $ADDR2LINE "-e tmpdir/testprog$exe [lindex $list 0]"]
- set want "$srcdir/.\*"
+ set want ".*"
if ![regexp $want $got] then {
fail "$testname\n wanted: $srcdir/$subdir/.*\n got: $got\n"
} else {
@@ -54,7 +54,7 @@ if ![regexp -line "^(\[0-9a-fA-F\]+)? +\
} else {
set list [regexp -inline -all -- {\S+} $contents]
set got [binutils_run $ADDR2LINE "-f -e tmpdir/testprog$exe [lindex $list 0]"]
- set want "fn\n$srcdir/.\*"
+ set want "fn\n.*"
if ![regexp $want $got] then {
fail "$testname -f option $got\n"
} else {
--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2023-08-04 16:05:45.721916727 +0100
+++ binutils-2.41/ld/testsuite/ld-plugin/lto.exp 2023-08-04 16:13:11.794221039 +0100
@@ -31,8 +31,8 @@ if { ![check_plugin_api_available]
set saved_CFLAGS "$CFLAGS_FOR_TARGET"
set saved_CXXFLAGS "$CXXFLAGS_FOR_TARGET"
-regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CFLAGS_FOR_TARGET "" CFLAGS_FOR_TARGET
-regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CXXFLAGS_FOR_TARGET "" CXXFLAGS_FOR_TARGET
+# regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CFLAGS_FOR_TARGET "" CFLAGS_FOR_TARGET
+# regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CXXFLAGS_FOR_TARGET "" CXXFLAGS_FOR_TARGET
proc restore_notify { } {
global saved_CFLAGS
--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2023-08-04 16:43:51.926589278 +0100
+++ binutils-2.41/ld/testsuite/ld-plugin/lto.exp 2023-08-04 16:45:14.323650391 +0100
@@ -474,7 +474,7 @@ set lto_link_elf_tests [list \
[list \
"Build libpr28879a.so" \
"-shared" \
- "-O0 -fpic" \
+ "-O2 -fpic" \
{pr28879a.cc} \
{} \
"libpr28879a.so" \
@@ -491,7 +491,7 @@ set lto_link_elf_tests [list \
[list \
"Build pr28879" \
"-Wl,--no-as-needed tmpdir/libpr28879b.so -Wl,-rpath-link,." \
- "-O0 -flto -D_GLIBCXX_ASSERTIONS" \
+ "-O2 -flto -D_GLIBCXX_ASSERTIONS" \
{pr28879b.cc} \
{} \
"pr28879" \
@@ -525,7 +525,7 @@ set lto_link_elf_tests [list \
[list \
"PR ld/pr29086" \
"-Wl,--wrap=foo" \
- "-O0 -flto" \
+ "-O2 -flto" \
{pr29086.c} \
{} \
"pr29086" \
diff -rup binutils.orig/ld/testsuite/ld-aarch64/bti-plt-5.d binutils-2.41/ld/testsuite/ld-aarch64/bti-plt-5.d
--- binutils.orig/ld/testsuite/ld-aarch64/bti-plt-5.d 2023-08-15 09:03:21.676463687 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/bti-plt-5.d 2023-08-15 09:17:56.751533569 +0100
@@ -12,8 +12,8 @@ Disassembly of section \.plt:
[0-9a-f]+ <.*>:
.*: d503245f bti c
.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
-.*: 90000090 adrp x16, 410000 <.*>
-.*: f9...... ldr x17, \[x16, #....\]
+.*: 90000090 adrp x16, 4.0000 <.*>
+.*: f9...... ldr x17, \[x16, #.*\]
.*: 91...... add x16, x16, #0x...
.*: d61f0220 br x17
.*: d503201f nop
@@ -21,8 +21,8 @@ Disassembly of section \.plt:
[0-9a-f]+ <.*>:
.*: d503245f bti c
-.*: 90000090 adrp x16, 410000 <.*>
-.*: f9...... ldr x17, \[x16, #....\]
+.*: 90000090 adrp x16, 4.0000 <.*>
+.*: f9...... ldr x17, \[x16, #.*\]
.*: 91...... add x16, x16, #0x...
.*: d61f0220 br x17
.*: d503201f nop
diff -rup binutils.orig/ld/testsuite/ld-aarch64/erratum843419-far-full.d binutils-2.41/ld/testsuite/ld-aarch64/erratum843419-far-full.d
--- binutils.orig/ld/testsuite/ld-aarch64/erratum843419-far-full.d 2023-08-15 09:03:21.683463694 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/erratum843419-far-full.d 2023-08-15 09:05:41.549608111 +0100
@@ -8,7 +8,7 @@ Disassembly of section \.text:
0*400000 <_start>:
...
- 400ffc: 90400000 adrp x0, 80400000 <__bss_end__\+0x7ffedff0>
+ 400ffc: 90400000 adrp x0, 80400000 <__bss_end__\+0x[0-9a-f]+>
401000: f9000042 str x2, \[x2\]
401004: d2800002 mov x2, #0x0 // #0
401008: 14000004 b 401018 <e843419@0002_00000010_1008>
@@ -18,5 +18,5 @@ Disassembly of section \.text:
0*401018 <e843419@0002_00000010_1008>:
401018: f9402001 ldr x1, \[x0, #64\]
- 40101c: 17fffffc b 40100c <_start\+0x100c>
+ 40101c: 17fffffc b 40100c <_start\+0x[0-9a-f]+>
...
diff -rup binutils.orig/ld/testsuite/ld-aarch64/farcall-b-plt.d binutils-2.41/ld/testsuite/ld-aarch64/farcall-b-plt.d
--- binutils.orig/ld/testsuite/ld-aarch64/farcall-b-plt.d 2023-08-15 09:03:21.683463694 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/farcall-b-plt.d 2023-08-15 09:07:02.046699709 +0100
@@ -10,7 +10,7 @@ Disassembly of section .plt:
.* <.plt>:
.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
-.*: .* adrp x16, .* <__foo_veneer\+.*>
+.*: .* adrp x16, .* <.*>
.*: .* ldr [wx]17, \[x16, #.*\]
.*: .* add [wx]16, [wx]16, #.*
.*: d61f0220 br x17
@@ -19,7 +19,7 @@ Disassembly of section .plt:
.*: d503201f nop
.* <foo@plt>:
-.*: .* adrp x16, .* <__foo_veneer\+.*>
+.*: .* adrp x16, .* <.*>
.*: .* ldr [wx]17, \[x16, #.*\]
.*: .* add [wx]16, [wx]16, #.*
.*: d61f0220 br x17
@@ -35,7 +35,7 @@ Disassembly of section .text:
.*: .* nop
.* <__foo_veneer>:
-.*: .* adrp x16, 0 <.*>
+.*: .* adrp x16, [0-9a-f]+ <.*>
.*: .* add x16, x16, #.*
.*: d61f0200 br x16
...
diff -rup binutils.orig/ld/testsuite/ld-aarch64/farcall-bl-plt.d binutils-2.41/ld/testsuite/ld-aarch64/farcall-bl-plt.d
--- binutils.orig/ld/testsuite/ld-aarch64/farcall-bl-plt.d 2023-08-15 09:03:21.684463695 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/farcall-bl-plt.d 2023-08-15 09:07:53.198757913 +0100
@@ -10,7 +10,7 @@ Disassembly of section .plt:
.* <.plt>:
.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
-.*: .* adrp x16, .* <__foo_veneer\+.*>
+.*: .* adrp x16, .* <.*>
.*: .* ldr [wx]17, \[x16, #.*\]
.*: .* add [wx]16, [wx]16, #.*
.*: d61f0220 br x17
@@ -19,7 +19,7 @@ Disassembly of section .plt:
.*: d503201f nop
.* <foo@plt>:
-.*: .* adrp x16, .* <__foo_veneer\+.*>
+.*: .* adrp x16, .* <.*>
.*: .* ldr [wx]17, \[x16, #.*\]
.*: .* add [wx]16, [wx]16, #.*
.*: d61f0220 br x17
@@ -35,7 +35,7 @@ Disassembly of section .text:
.*: .* nop
.* <__foo_veneer>:
-.*: .* adrp x16, 0 <.*>
+.*: .* adrp x16, [0-9a-f]+ <.*>
.*: .* add x16, x16, #.*
.*: d61f0200 br x16
...
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-1-local.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-1-local.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-1-local.d 2023-08-15 09:03:21.685463696 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-1-local.d 2023-08-15 09:08:50.622823248 +0100
@@ -3,7 +3,3 @@
#objdump: -dw
-#...
-0+(110|180|1a0) <(__GI_)?foo>:
-#...
-[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+(0x110|0x180|0x1a0)@plt>
#pass
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-1.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-1.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-1.d 2023-08-15 09:03:21.685463696 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-1.d 2023-08-15 09:08:18.190786345 +0100
@@ -3,7 +3,3 @@
#objdump: -dw
-#...
-0+(130|1a0|1c8) <foo>:
-#...
-[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(130|1a0|1c8)@plt>
#pass
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-2-local.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-2-local.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-2-local.d 2023-08-15 09:03:21.685463696 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-2-local.d 2023-08-15 09:09:27.982865763 +0100
@@ -3,8 +3,6 @@
#objdump: -dw
#...
-0+(110|180|1a0) <__GI_foo>:
-#...
[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(110|180|1a0)@plt>
[ \t0-9a-f]+:[ \t0-9a-f]+adrp[ \t]+x0, 0 <.*>
[ \t0-9a-f]+:[ \t0-9a-f]+add[ \t]+x0, x0, #0x(100|170|190)
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-2.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-2.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-2.d 2023-08-15 09:03:21.686463697 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-2.d 2023-08-15 09:09:14.350850251 +0100
@@ -3,8 +3,6 @@
#objdump: -dw
#...
-0+(130|1a0|1c8) <foo>:
-#...
[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(130|1a0|1c8)@plt>
[ \t0-9a-f]+:[ \t0-9a-f]+adrp[ \t]+x0, 0 <.*>
[ \t0-9a-f]+:[ \t0-9a-f]+add[ \t]+x0, x0, #0x(120|190|1b8)
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-21.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-21.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-21.d 2023-08-15 09:03:21.686463697 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-21.d 2023-08-15 09:13:27.007155679 +0100
@@ -11,7 +11,7 @@ Contents of section .text:
[0-9a-f]+ .*
Contents of section .got.plt:
[0-9a-f]+ 0+ 0+ 0+ 0+ .*
- (10298|102b8) 0+ 0+ [0-9a-f]+ [0-9a-f]+ .*
+ (10298|102b8|20108) 0+ 0+ [0-9a-f]+ [0-9a-f]+ .*
Disassembly of section .text:
@@ -19,8 +19,8 @@ Disassembly of section .text:
.*: d65f03c0 ret
.* <bar>:
- .*: 90000080 adrp x0, 10000 <.*>
- .*: .* ldr x0, \[x0, #(672|704)\]
+ .*: 90000080 adrp x0, .0000 <.*>
+ .*: .* ldr x0, \[x0, #(672|704|272)\]
.*: d65f03c0 ret
#pass
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-22.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-22.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-22.d 2023-08-15 09:03:21.686463697 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-22.d 2023-08-15 09:14:02.191199743 +0100
@@ -8,4 +8,4 @@
.*: file format elf64-(little|big)aarch64
Contents of section \.got:
- [0-9a-f]+ 00000000 00000000 (d0004000|18004000|00000000) (00000000|004000d0|00400018) .*
+#pass
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-3a.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-3a.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-3a.d 2023-08-15 09:03:21.686463697 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-3a.d 2023-08-15 09:09:42.174882286 +0100
@@ -4,7 +4,5 @@
#objdump: -dw
#...
-0+(150|1d0|1e8) <__GI_foo>:
-#...
[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(150|1d0|1e8)@plt>
#pass
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-7c.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-7c.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-7c.d 2023-08-15 09:03:21.686463697 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-7c.d 2023-08-15 09:11:37.716022782 +0100
@@ -11,9 +11,9 @@
Disassembly of section \.text:
[0-9a-f]+ <foo>:
- [0-9a-f]+: d65f03c0 ret
+[ ]+[0-9a-f]+:[ ]+d65f03c0[ ]+ret
[0-9a-f]+ <__start>:
- [0-9a-f]+: [0-9a-f]+ bl [0-9a-f]+ <\*ABS\*\+0x[0-9a-f]+@plt>
- [0-9a-f]+: [0-9a-f]+ adrp x0, [0-9]+ <__start\+0x[0-9a-f]+>
- [0-9a-f]+: [0-9a-f]+ ldr x0, \[x0, .+\]
+[ ]+[0-9a-f]+:[ ]+[0-9a-f]+[ ]+bl[ ]+[0-9a-f]+ <\*ABS\*\+0x[0-9a-f]+@plt>
+[ ]+[0-9a-f]+:[ ]+[0-9a-f]+[ ]+adrp[ ]+x0, [0-9]+ <.*>
+[ ]+[0-9a-f]+:[ ]+[0-9a-f]+[ ]+ldr[ ]+x0, \[x0, .+\]
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-2-local.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-2-local.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-2-local.d 2023-08-15 11:17:45.947214180 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-2-local.d 2023-08-15 11:18:17.319251036 +0100
@@ -2,8 +2,4 @@
#ld: -shared --hash-style=sysv
#objdump: -dw
-#...
-[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(110|180|1a0)@plt>
-[ \t0-9a-f]+:[ \t0-9a-f]+adrp[ \t]+x0, 0 <.*>
-[ \t0-9a-f]+:[ \t0-9a-f]+add[ \t]+x0, x0, #0x(100|170|190)
#pass
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-2.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-2.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-2.d 2023-08-15 11:17:45.947214180 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-2.d 2023-08-15 11:18:02.935234133 +0100
@@ -2,8 +2,4 @@
#ld: -shared --hash-style=sysv
#objdump: -dw
-#...
-[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(130|1a0|1c8)@plt>
-[ \t0-9a-f]+:[ \t0-9a-f]+adrp[ \t]+x0, 0 <.*>
-[ \t0-9a-f]+:[ \t0-9a-f]+add[ \t]+x0, x0, #0x(120|190|1b8)
#pass
diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-3a.d binutils-2.41/ld/testsuite/ld-aarch64/ifunc-3a.d
--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-3a.d 2023-08-15 11:17:45.947214180 +0100
+++ binutils-2.41/ld/testsuite/ld-aarch64/ifunc-3a.d 2023-08-15 11:18:37.703274987 +0100
@@ -3,6 +3,4 @@
#ld: -shared --hash-style=sysv
#objdump: -dw
-#...
-[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(150|1d0|1e8)@plt>
#pass
--- binutils.orig/ld/testsuite/ld-elf/binutils.exp 2023-08-15 14:30:13.138890662 +0100
+++ binutils-2.41/ld/testsuite/ld-elf/binutils.exp 2023-08-15 14:33:16.133301230 +0100
@@ -174,7 +174,7 @@ binutils_test strip "-T ${srcdir}/${subd
set tls_tests { "tdata1" "tdata2" }
# hppa64 has its own .tbss section, with different flags.
-if { ![istarget "hppa64-*-*"] } {
+if { ![istarget "hppa64-*-*"] && ![istarget "powerpc*-*-*"] } {
lappend tls_tests "tdata3" "tbss1" "tbss2" "tbss3"
}
set tls_opts {
diff -rup binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp binutils-2.41/ld/testsuite/ld-powerpc/powerpc.exp
--- binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp 2023-08-15 14:30:13.277890866 +0100
+++ binutils-2.41/ld/testsuite/ld-powerpc/powerpc.exp 2023-08-15 14:41:18.582395219 +0100
@@ -126,65 +126,6 @@ set ppcelftests {
"tls32no"}
{"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 -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 -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 -z notext tmpdir/tls32.o" "" "" {}
- {{readelf -WSsrl tlsso32.r} {objdump -dr tlsso32.d}
- {objdump -sj.got tlsso32.g} {objdump -sj.tdata tlsso32.t}}
- "tls32.so"}
- {"TLS32 markers" "-melf32ppc" "" "-a32" {tlsmark32.s tlslib32.s}
- {{objdump -dr tlsmark32.d}}
- "tlsmark32"}
- {"TLS32 opt 1" "-melf32ppc" "" "-a32" {tlsopt1_32.s tlslib32.s}
- {{objdump -dr tlsopt1_32.d}}
- "tlsopt1_32"}
- {"TLS32 opt 2" "-melf32ppc" "" "-a32" {tlsopt2_32.s tlslib32.s}
- {{objdump -dr tlsopt2_32.d}}
- "tlsopt2_32"}
- {"TLS32 opt 3" "-melf32ppc" "" "-a32" {tlsopt3_32.s tlslib32.s}
- {{objdump -dr tlsopt3_32.d}}
- "tlsopt3_32"}
- {"TLS32 opt 4" "-melf32ppc" "" "-a32" {tlsopt4_32.s tlslib32.s}
- {{objdump -dr tlsopt4_32.d}}
- "tlsopt4_32"}
- {"TLS32 DLL" "-shared -melf32ppc --version-script tlsdll.ver" ""
- "-a32" {tlsdll_32.s}
- {} "tlsdll32.so"}
- {"TLS32 opt 5" "-melf32ppc -shared --gc-sections --secure-plt --no-plt-align tmpdir/tlsdll32.so" "" "-a32" {tlsopt5_32.s}
- {{objdump -dr tlsopt5_32.d}}
- "tlsopt5_32"}
- {"Shared library with global symbol" "-shared -melf32ppc" "" "-a32" {sdalib.s}
- {} "sdalib.so"}
- {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "" "-a32" {sdadyn.s}
- {{objdump -R sdadyn.d}} "sdadyn"}
- {"relaxing" "-melf32ppc --relax -Ttext=0 --defsym far=0x80001234 --defsym near=0x00004320" "" "-a32" "relax.s"
- {{objdump -dr relax.d}}
- "relax"}
- {"relocatable relaxing" "-melf32ppc -r --relax" "" "-a32" "relax.s"
- {{objdump -dr relaxr.d}}
- "rrelax"}
- {"relocatable relaxing large" "-melf32ppc -r --relax" "" "-a32" "relax.s big.s"
- {{objdump -dr relaxrl.d}}
- "rrelax"}
- {"build empty shared library" "-shared" "" "" "empty.s" {} "empty.so"}
- {"abs32-static" "-melf32ppc -static --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x12345678" ""
- "-a32" {abs32-reloc.s}
- {{objdump {-dr} abs32-static.d}
- {readelf {-rW} abs32-static.r}} "abs32-static"}
- {"abs32-pie" "-melf32ppc -pie --hash-style=sysv --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x12345678" ""
- "-a32" {abs32-reloc.s}
- {{objdump {-dr} abs32-pie.d}
- {readelf {-rW} abs32-pie.r}} "abs32-pie"}
- {"abs32-shared" "-melf32ppc -shared --hash-style=sysv --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x12345678" ""
- "-a32" {abs32-reloc.s}
- {{objdump {-dr} abs32-shared.d}
- {readelf {-rW} abs32-shared.r}} "abs32-shared"}
}
set ppc64elftests {
@@ -192,200 +133,6 @@ set ppc64elftests {
"-a64 --defsym TLSMARK=1" {tls.s tlslib.s}
{{objdump -dr tls.d} {objdump -sj.got tls.g} {objdump -sj.tdata tls.t}}
"tlsm"}
- {"TLS static exec" "-melf64ppc --no-plt-align" "" "-a64" {tls.s tlslib.s}
- {{objdump -dr tls.d} {objdump -sj.got tls.g} {objdump -sj.tdata tls.t}}
- "tls"}
- {"TLS static exec (--no-tls-optimize)" "-melf64ppc --no-tls-optimize --no-plt-align" ""
- "-a64 --defsym TLSMARK=1" {tls.s tlslib.s}
- {{objdump -dr tlsno.d} {objdump -sj.got tlsno.g} {objdump -sj.tdata tls.t}}
- "tlsno"}
- {"TLS helper shared library" "-shared -melf64ppc tmpdir/tlslib.o" "" "" {}
- {} "libtlslib.so"}
- {"TLS helper old shared lib" "-shared -melf64ppc" "" "-a64" {oldtlslib.s}
- {} "liboldlib.so"}
- {"TLS dynamic exec" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/libtlslib.so" "" "" {}
- {{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d}
- {objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}}
- "tlsexe"}
- {"TLS dynamic old" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/liboldlib.so" "" "" {}
- {{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d}
- {objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}}
- "tlsexeold"}
- {"TLS dynamic exec (--no-tls-optimize)" "-melf64ppc --no-tls-optimize --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/libtlslib.so" "" "" {}
- {{readelf -WSsrl tlsexeno.r} {objdump -dr tlsexeno.d}
- {objdump -sj.got tlsexeno.g} {objdump -sj.tdata tlsexe.t}}
- "tlsexeno"}
- {"TLS shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv -z notext tmpdir/tls.o" "" "" {}
- {{readelf -WSsrl tlsso.r} {objdump -dr tlsso.d}
- {objdump -sj.got tlsso.g} {objdump -sj.tdata tlsso.t}}
- "tls.so"}
- {"TLSTOC static exec" "-melf64ppc tmpdir/tlslib.o" "" "-a64" {tlstoc.s}
- {{objdump -dr tlstoc.d} {objdump -sj.got tlstoc.g}
- {objdump -sj.tdata tlstoc.t}}
- "tlstoc"}
- {"TLSTOC static exec (--no-tls-optimize)" "-melf64ppc --no-tls-optimize tmpdir/tlslib.o tmpdir/tlstoc.o" "" "" {}
- {{objdump -dr tlstocno.d} {objdump -sj.got tlstocno.g}
- {objdump -sj.tdata tlstoc.t}}
- "tlstocno"}
- {"TLSTOC dynamic exec" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" ""
- "" {}
- {{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d}
- {objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}}
- "tlsexetoc"}
- {"TLSTOC dynamic old" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/liboldlib.so" ""
- "" {}
- {{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d}
- {objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}}
- "tlsexetocold"}
- {"TLSTOC dynamic exec (--no-tls-optimize)" "-melf64ppc --no-tls-optimize --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" ""
- "" {}
- {{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetocno.d}
- {objdump -sj.got tlsexetocno.g} {objdump -sj.tdata tlsexetoc.t}}
- "tlsexetocno"}
- {"TLSTOC shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv -z notext tmpdir/tlstoc.o" "" "" {}
- {{readelf -WSsrl tlstocso.r} {objdump -dr tlstocso.d}
- {objdump -sj.got tlstocso.g} {objdump -sj.tdata tlstocso.t}}
- "tlstoc.so"}
- {"TLS dynamic exec (--tls-get-addr-regsave)" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv --tls-get-addr-regsave tmpdir/tls.o tmpdir/libtlslib.so" "" "" {}
- {{readelf -WSsrl tlsexers.r} {objdump -dr tlsexers.d}
- {objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}}
- "tlsexers"}
- {"TLS dynamic exec (--no-tls-optimize --tls-get-addr-regsave)" "-melf64ppc --no-tls-optimize --tls-get-addr-regsave --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/libtlslib.so" "" "" {}
- {{readelf -WSsrl tlsexenors.r} {objdump -dr tlsexenors.d}
- {objdump -sj.got tlsexeno.g} {objdump -sj.tdata tlsexe.t}}
- "tlsexenors"}
- {"TLSTOC dynamic exec (--tls-get-addr-regsave)" "-melf64ppc --tls-get-addr-regsave --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" ""
- "" {}
- {{readelf -WSsrl tlsexetocrs.r} {objdump -dr tlsexetocrs.d}
- {objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}}
- "tlsexetocrs"}
- {"TLSTOC dynamic exec (--no-tls-optimize --tls-get-addr-regsave)" "-melf64ppc --no-tls-optimize --tls-get-addr-regsave --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" ""
- "" {}
- {{readelf -WSsrl tlsexetocrs.r} {objdump -dr tlsexetocnors.d}
- {objdump -sj.got tlsexetocno.g} {objdump -sj.tdata tlsexetoc.t}}
- "tlsexetocnors"}
- {"TLS markers" "-melf64ppc" "" "-a64" {tlsmark.s tlslib.s}
- {{objdump -dr tlsmark.d}}
- "tlsmark"}
- {"TLS opt 1" "-melf64ppc" "" "-a64" {tlsopt1.s tlslib.s}
- {{objdump -dr tlsopt1.d}}
- "tlsopt1"}
- {"TLS opt 2" "-melf64ppc" "" "-a64" {tlsopt2.s tlslib.s}
- {{objdump -dr tlsopt2.d}}
- "tlsopt2"}
- {"TLS opt 3" "-melf64ppc" "" "-a64" {tlsopt3.s tlslib.s}
- {{objdump -dr tlsopt3.d}}
- "tlsopt3"}
- {"TLS opt 4" "-melf64ppc" "" "-a64" {tlsopt4.s tlslib.s}
- {{objdump -dr tlsopt4.d}}
- "tlsopt4"}
- {"TLS DLL" "-shared -melf64ppc --version-script tlsdll.ver" "" "-a64" {tlsdll.s}
- {} "tlsdll.so"}
- {"TLS opt 5" "-melf64ppc -shared --hash-style=both --gc-sections --no-plt-localentry tmpdir/tlsdll.so" "" "-a64" {tlsopt5.s}
- {{objdump -dr tlsopt5.d} {readelf -wf tlsopt5.wf}}
- "tlsopt5"}
- {"TLS opt 6" "-melf64ppc -shared --hash-style=both --gc-sections --no-plt-localentry --tls-get-addr-regsave tmpdir/tlsdll.so" "" "-a64" {tlsopt5.s}
- {{objdump -dr tlsopt6.d} {readelf -wf tlsopt6.wf}}
- "tlsopt6"}
- {"TLSdesc" "-melf64ppc -shared --hash-style=both --no-plt-localentry tmpdir/libtlslib.so" "" "-a64" {tlsdesc.s}
- {{objdump -dr tlsdesc.d} {readelf -wf tlsdesc.wf}}
- "tlsdesc"}
- {"TLSdesc2" "-melf64ppc -shared --hash-style=both --no-plt-localentry tmpdir/tlsdll.so" "" "-a64" {tlsdesc.s}
- {{objdump -dr tlsdesc2.d} {readelf -wf tlsdesc2.wf}}
- "tlsdesc2"}
- {"TLSdesc3" "-melf64ppc --no-tls-optimize tmpdir/tlsdll.o" "" "-a64" {tlsdesc.s}
- {{objdump -dr tlsdesc3.d} {readelf -wf tlsdesc3.wf}}
- "tlsdesc3"}
- {"TLSdesc4" "-melf64ppc --no-tls-optimize tmpdir/tlsdll.o" "" "-a64" {tlsdesc4.s}
- {{objdump -dr tlsdesc4.d} {readelf -wf tlsdesc4.wf}}
- "tlsdesc4"}
- {"tlsget" "-shared --hash-style=both -melf64ppc --plt-align=0" "tmpdir/tlsdll.so" "-a64 -mpower10" {tlsget.s}
- {{objdump -dr tlsget.d} {readelf -wf tlsget.wf}}
- "tlsget.so"}
- {"tlsget2" "-shared --hash-style=both -melf64ppc --plt-align=0 --power10-stubs=yes" "tmpdir/tlsdll.so" "-a64 -mpower10" {tlsget.s}
- {{objdump -dr tlsget2.d} {readelf -wf tlsget2.wf}}
- "tlsget2.so"}
- {"sym@tocbase" "-shared -melf64ppc" "" "-a64" {symtocbase-1.s symtocbase-2.s}
- {{objdump -dj.data symtocbase.d}} "symtocbase.so"}
- {"TOC opt" "-melf64ppc" "" "-a64" {tocopt.s}
- {{ld tocopt.out} {objdump -s tocopt.d}} "tocopt"}
- {"TOC opt2" "-melf64ppc --defsym x=2" "" "-a64" {tocopt2.s}
- {{ld tocopt2.out} {objdump -s tocopt2.d}} "tocopt2"}
- {"TOC opt3" "-melf64ppc -no-keep-memory --defsym x=2" "" "-a64" {tocopt3.s}
- {{objdump -s tocopt3.d}} "tocopt3"}
- {"TOC opt4" "-melf64ppc -no-keep-memory --defsym x=2" "" "-a64"
- {tocopt4a.s tocopt4b.s} {{objdump -s tocopt4.d}} "tocopt4"}
- {"TOC opt5" "-melf64ppc" "" "-a64" {tocopt5.s}
- {{objdump -s tocopt5.d}} "tocopt5"}
- {"TOC opt6" "-melf64ppc" "" "-a64" {tocopt6a.s tocopt6b.s tocopt6c.s}
- {{objdump -d tocopt6.d}} "tocopt6"}
- {"TOC opt7" "-melf64ppc" "" "-a64 -mpower9" {tocopt7.s}
- {{ld tocopt7.out} {objdump -s tocopt7.d}} "tocopt7"}
- {"TOC opt8" "-melf64ppc" "" "-a64 -mpower9" {tocopt8.s}
- {{objdump -s tocopt8.d}} "tocopt8"}
- {"tocsave lib" "-shared -melf64ppc" "" "-a64" {tocsavelib.s}
- {} "tocsavelib.so"}
- {"tocsave1 shared" "-melf64ppc" "tmpdir/tocsavelib.so" "-a64" {tocsave1.s}
- {{objdump -dr tocsave1s.d}} "tocsave1s"}
- {"tocsave1 static" "-melf64ppc" "tmpdir/tocsavelib.o" "-a64" {tocsave1.s}
- {{objdump -dr tocsave1a.d}} "tocsave1a"}
- {"tocsave2 shared" "-melf64ppc" "tmpdir/tocsavelib.so" "-a64" {tocsave2.s}
- {{objdump -dr tocsave2s.d}} "tocsave2s"}
- {"tocsave2 static" "-melf64ppc" "tmpdir/tocsavelib.o" "-a64" {tocsave2.s}
- {{objdump -dr tocsave2a.d}} "tocsave2a"}
- {"ambig shared v1" "-shared -melf64ppc" "" "-a64" {funv1.s} {} "funv1.so"}
- {"ambig shared v2" "-shared -melf64ppc" "" "-a64" {funv2.s} {} "funv2.so"}
- {"notoc ext" "" "" "-a64" {ext.s} {} ""}
- {"notoc" "-melf64ppc --no-plt-localentry --no-power10-stubs -T ext.lnk"
- "" "-a64" {notoc.s}
- {{objdump -d notoc.d} {readelf {-wf -W} notoc.wf}} "notoc"}
- {"notoc2" "-melf64ppc -shared" "" "-a64 -mpower10" {notoc2.s}
- {{objdump {-d -Mpower10} notoc2.d}} "notoc2"}
- {"notoc3" "-melf64ppc --no-plt-localentry -T ext.lnk" ""
- "-a64 -mpower10" {notoc3.s}
- {{objdump -d notoc3.d} {readelf {-wf -W} notoc3.wf}} "notoc3"}
- {"pcrelopt" "-melf64ppc --hash-style=gnu" "tmpdir/symtocbase.so"
- "-a64 -mpower10" {pcrelopt.s}
- {{objdump {-d -Mpower10} pcrelopt.d}
- {readelf {-S --wide} pcrelopt.sec}} "pcrelopt" }
- {"group1" "-melf64ppc -e foo" "" "-a64" {group1.s group2.s group3.s}
- {{objdump {-d} group1.d}
- {readelf {-s} group1.sym}} "group1"}
- {"group2" "-melf64ppc -e foo" "" "-a64" {group2.s group1.s group3.s}
- {{objdump {-d} group2.d}
- {readelf {-s} group2.sym}} "group2"}
- {"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"}
- {"startstop" "-shared -melf64ppc --hash-style=sysv --gc-sections -z start-stop-gc" ""
- "-a64 -mpower10" {startstop.s}
- {{objdump -d startstop.d} {readelf {-rW} startstop.r}} "startstop.so"}
- {"abs-static" "-melf64ppc -static --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x123456789abcdef0" ""
- "-a64" {abs-reloc.s}
- {{objdump {-sdr} abs-static.d}
- {readelf {-rW} abs-static.r}} "abs-static"}
- {"abs-pie" "-melf64ppc -pie --hash-style=sysv --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x123456789abcdef0" ""
- "-a64" {abs-reloc.s}
- {{objdump {-sdr} abs-pie.d}
- {readelf {-rW} abs-pie.r}} "abs-pie"}
- {"abs-shared" "-melf64ppc -shared --hash-style=sysv --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x123456789abcdef0" ""
- "-a64" {abs-reloc.s}
- {{objdump {-sdr} abs-shared.d}
- {readelf {-rW} abs-shared.r}} "abs-shared"}
- {"abs-pie-relr" "-melf64ppc -pie --hash-style=sysv -z pack-relative-relocs --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x123456789abcdef0" ""
- "-a64" {abs-reloc.s}
- {{objdump {-sdr} abs-pie-relr.d}
- {readelf {-rW} abs-pie-relr.r}} "abs-pie-relr"}
- {"abs-shared-relr" "-melf64ppc -shared --hash-style=sysv -z pack-relative-relocs --defsym a=1 --defsym 'HIDDEN(b=2)' --defsym c=0x123456789abcdef0" ""
- "-a64" {abs-reloc.s}
- {{objdump {-sdr} abs-shared-relr.d}
- {readelf {-rW} abs-shared-relr.r}} "abs-shared-relr"}
}
set ppceabitests {
@@ -404,15 +151,6 @@ set ppceabitests {
{"VLE multiple segments 5" "-melf32ppc -T vle-multiseg-5.ld" ""
"-a32 -mbig -mregnames -mvle" {vle-multiseg.s}
{{readelf "-l" vle-multiseg-5.d}} "vle-multiseg-5"}
- {"VLE relocations 1" "-melf32ppc -T vle.ld" ""
- "-a32 -mbig -mvle" {vle-reloc-1.s vle-reloc-def-1.s}
- {{objdump "-Mvle -d" vle-reloc-1.d}} "vle-reloc-1"}
- {"VLE relocations 2" "-melf32ppc -T vle.ld" ""
- "-a32 -mbig -mvle" {vle-reloc-2.s vle-reloc-def-2.s}
- {{objdump "-Mvle -d" vle-reloc-2.d}} "vle-reloc-2"}
- {"VLE relocations 3" "-melf32ppc -T vle.ld" ""
- "-a32 -mbig -mvle" {vle-reloc-3.s vle-reloc-def-3.s}
- {{objdump "-Mvle -d" vle-reloc-3.d}} "vle-reloc-3"}
}
if [istarget "powerpc*le*-*-*"] then {
diff -rup binutils.orig/ld/testsuite/ld-powerpc/tls32.d binutils-2.41/ld/testsuite/ld-powerpc/tls32.d
--- binutils.orig/ld/testsuite/ld-powerpc/tls32.d 2023-08-15 14:30:13.278890868 +0100
+++ binutils-2.41/ld/testsuite/ld-powerpc/tls32.d 2023-08-15 14:35:25.141593764 +0100
@@ -9,11 +9,11 @@
Disassembly of section \.text:
-0+18000a0 <_start>:
+0+18[0-9a-f]+ <_start>:
.*: (42 9f 00 05|05 00 9f 42) bcl 20,4\*cr7\+so,.* <_start\+0x4>
.*: (7f c8 02 a6|a6 02 c8 7f) mflr r30
.*: (3f de 00 02|02 00 de 3f) addis r30,r30,2
-.*: (3b de 80 a0|a0 80 de 3b) addi r30,r30,-32608
+.*: (3b de 80 a0|.. 80 de 3b) addi r30,r30,.*
.*: (60 00 00 00|00 00 00 60) nop
.*: (38 62 90 3c|3c 90 62 38) addi r3,r2,-28612
.*: (60 00 00 00|00 00 00 60) nop
@@ -43,5 +43,5 @@ Disassembly of section \.text:
.*: (60 00 00 00|00 00 00 60) nop
.*: (a9 42 90 18|18 90 42 a9) lha r10,-28648\(r2\)
-0+1800120 <__tls_get_addr>:
+0+18[0-9a-f]+ <__tls_get_addr>:
.*: (4e 80 00 20|20 00 80 4e) blr
--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2023-08-15 14:30:13.165890702 +0100
+++ binutils-2.41/ld/testsuite/ld-elf/shared.exp 2023-08-15 14:45:41.943992390 +0100
@@ -1152,10 +1152,6 @@ set run_tests [list \
[list "Run pr21964-3" \
"-Wl,--no-as-needed,-rpath,tmpdir tmpdir/pr21964-1a.so tmpdir/pr21964-1b.so tmpdir/pr21964-3a.so" "" \
{pr21964-3c.c} "pr21964-3" "pass.out" ] \
- [list "pr26580-3" \
- "" "" \
- {pr26580-a.c} "pr26580-3" "pr26580-3.out" "-fcommon" "c" "" \
- "-Wl,--as-needed tmpdir/libpr26580-2.so" ] \
[list "pr26580-4" \
"" "" \
{pr26580-a.c} "pr26580-4" "pr26580-4.out" "-fcommon" "c" "" \
@@ -1579,18 +1575,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-s390/s390.exp 2023-08-15 14:30:13.292890888 +0100
+++ binutils-2.41/ld/testsuite/ld-s390/s390.exp 2023-08-15 14:48:38.327360916 +0100
@@ -35,6 +35,8 @@ if { !([istarget "s390-*-*"] || [istarge
# nm: Apply nm options on result. Compare with regex (last arg).
# readelf: Apply readelf options on result. Compare with regex (last arg).
+return
+
set s390tests {
{"TLS -fpic -shared transitions" "-shared -melf_s390 --hash-style=sysv" ""
"-m31" {tlspic1.s tlspic2.s}
--- binutils.orig/ld/testsuite/ld-elf/linux-x86.exp 2023-08-15 14:30:13.146890674 +0100
+++ binutils-2.41/ld/testsuite/ld-elf/linux-x86.exp 2023-08-15 14:54:31.527999066 +0100
@@ -152,6 +152,10 @@ run_cc_link_tests [list \
] \
]
+if { [istarget "i686-*-*"] } {
+ return
+}
+
run_ld_link_exec_tests [list \
[list \
"Run indirect-extern-access-1a without PIE" \
--- binutils.orig/ld/testsuite/ld-i386/i386.exp 2023-08-15 14:30:13.183890728 +0100
+++ binutils-2.41/ld/testsuite/ld-i386/i386.exp 2023-08-15 14:55:59.001157084 +0100
@@ -597,6 +597,10 @@ proc undefined_weak {cflags ldflags} {
}
}
+if { [istarget "i686-*-*"] } {
+ return
+}
+
# Must be Linux native with the C compiler
if { [isnative]
&& [istarget "i?86-*-linux*"]
--- binutils.orig/ld/testsuite/ld-scripts/crossref.exp 2023-08-15 14:30:13.294890891 +0100
+++ binutils-2.41/ld/testsuite/ld-scripts/crossref.exp 2023-08-15 14:59:36.680591177 +0100
@@ -121,6 +121,10 @@ if [string match "" $exec_output] then {
}
}
+if { [istarget "i686-*-*"] } {
+ return
+}
+
# Check cross references for ld -r
if { ![ld_compile "$CC_FOR_TARGET $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" "$srcdir/$subdir/cross4.c" tmpdir/cross4.o] } {
--- binutils.orig/ld/testsuite/ld-shared/shared.exp 2023-08-15 14:30:13.309890913 +0100
+++ binutils-2.41/ld/testsuite/ld-shared/shared.exp 2023-08-15 15:00:31.929701875 +0100
@@ -204,6 +204,10 @@ if { [istarget mips*-*-*] && ! [at_least
}
verbose "Using $picflag to compile PIC code"
+if { [istarget "i686-*-*"] } {
+ return
+}
+
# Compile the main program.
if ![ld_compile "$CC_FOR_TARGET $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
unsupported "shared (non PIC)"
--- binutils.orig/ld/testsuite/ld-srec/srec.exp 2023-08-15 14:30:13.315890922 +0100
+++ binutils-2.41/ld/testsuite/ld-srec/srec.exp 2023-08-15 15:01:24.104806404 +0100
@@ -442,6 +442,9 @@ setup_xfail "csky*-*-*"
# The S-record linker is not supported for eBPF.
setup_xfail "bpf-*-*"
+setup_xfail "s390*-*-*"
+setup_xfail "i686-*-*"
+
run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
# Now try linking a C++ program with global constructors and
--- binutils.orig/ld/testsuite/ld-vsb/vsb.exp 2023-08-15 14:30:13.329890943 +0100
+++ binutils-2.41/ld/testsuite/ld-vsb/vsb.exp 2023-08-15 15:03:41.018080699 +0100
@@ -29,6 +29,10 @@ if { ![check_compiler_available] } {
return
}
+if { [istarget "i686-*-*"] } {
+ return
+}
+
# This test can only be run on a couple of ELF platforms or with
# XCOFF formats.
# Square bracket expressions seem to confuse istarget.
diff -rup binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp binutils-2.41/ld/testsuite/ld-powerpc/powerpc.exp
--- binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp 2023-08-15 15:04:24.106167010 +0100
+++ binutils-2.41/ld/testsuite/ld-powerpc/powerpc.exp 2023-08-15 15:59:51.422385730 +0100
@@ -177,6 +177,8 @@ if [istarget "powerpc*le*-*-*"] then {
run_ld_link_tests $ppcelftests
+return
+
if [ supports_ppc64 ] then {
run_ld_link_tests $ppc64elftests
run_dump_test "relbrlt"
diff -rup binutils.orig/ld/testsuite/ld-powerpc/tls.d binutils-2.41/ld/testsuite/ld-powerpc/tls.d
--- binutils.orig/ld/testsuite/ld-powerpc/tls.d 2023-08-15 15:04:24.100166998 +0100
+++ binutils-2.41/ld/testsuite/ld-powerpc/tls.d 2023-08-15 15:59:07.422314417 +0100
@@ -9,7 +9,7 @@
Disassembly of section \.text:
-0+100000e8 <\._start>:
+0+100..... <\._start>:
.*: (60 00 00 00|00 00 00 60) nop
.*: (38 6d 90 78|78 90 6d 38) addi r3,r13,-28552
.*: (60 00 00 00|00 00 00 60) nop
@@ -49,5 +49,5 @@ Disassembly of section \.text:
.*: (60 00 00 00|00 00 00 60) nop
.*: (a9 4d 90 30|30 90 4d a9) lha r10,-28624\(r13\)
-0+10000180 <\.__tls_get_addr>:
+0+100..... <\.__tls_get_addr>:
.*: (4e 80 00 20|20 00 80 4e) blr
diff -rup binutils.orig/ld/testsuite/ld-powerpc/tls32.g binutils-2.41/ld/testsuite/ld-powerpc/tls32.g
--- binutils.orig/ld/testsuite/ld-powerpc/tls32.g 2023-08-15 15:04:24.100166998 +0100
+++ binutils-2.41/ld/testsuite/ld-powerpc/tls32.g 2023-08-15 15:56:33.167064455 +0100
@@ -8,4 +8,4 @@
.*
Contents of section \.got:
- 1810144 00000000 00000000 00000000 .*
+ 18..... 00000000 00000000 00000000 .*
diff -rup binutils.orig/ld/testsuite/ld-powerpc/tls32no.d binutils-2.41/ld/testsuite/ld-powerpc/tls32no.d
--- binutils.orig/ld/testsuite/ld-powerpc/tls32no.d 2023-08-15 15:04:24.100166998 +0100
+++ binutils-2.41/ld/testsuite/ld-powerpc/tls32no.d 2023-08-15 15:58:02.959209959 +0100
@@ -9,11 +9,11 @@
Disassembly of section \.text:
-0+18000a0 <_start>:
+0+18..... <_start>:
.*: (42 9f 00 05|05 00 9f 42) bcl .*
.*: (7f c8 02 a6|a6 02 c8 7f) mflr r30
.*: (3f de 00 02|02 00 de 3f) addis r30,r30,2
-.*: (3b de 80 a0|a0 80 de 3b) addi r30,r30,-32608
+.*: (3b de 80 a0|.. 80 de 3b) addi r30,r30,-[0-9]+
.*: (38 7f ff e4|e4 ff 7f 38) addi r3,r31,-28
.*: (48 00 00 6d|6d 00 00 48) bl .*
.*: (38 7f ff f8|f8 ff 7f 38) addi r3,r31,-8
@@ -43,5 +43,5 @@ Disassembly of section \.text:
.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0
.*: (a9 49 90 18|18 90 49 a9) lha r10,-28648\(r9\)
-0+1800120 <__tls_get_addr>:
+0+18..... <__tls_get_addr>:
.*: (4e 80 00 20|20 00 80 4e) blr
--- binutils.orig/ld/testsuite/ld-elf/linux-x86.exp 2023-08-15 15:04:23.995166788 +0100
+++ binutils-2.41/ld/testsuite/ld-elf/linux-x86.exp 2023-08-15 16:03:11.615710200 +0100
@@ -73,6 +73,10 @@ run_ld_link_tests [list \
] \
]
+if { [istarget "i686-*-*"] } {
+ return
+}
+
run_cc_link_tests [list \
[list \
"Build indirect-extern-access-1.so" \
@@ -152,10 +156,6 @@ run_cc_link_tests [list \
] \
]
-if { [istarget "i686-*-*"] } {
- return
-}
-
run_ld_link_exec_tests [list \
[list \
"Run indirect-extern-access-1a without PIE" \
diff -rup binutils.orig/ld/testsuite/ld-powerpc/tls32.t binutils-2.41/ld/testsuite/ld-powerpc/tls32.t
--- binutils.orig/ld/testsuite/ld-powerpc/tls32.t 2023-08-15 16:48:58.540653339 +0100
+++ binutils-2.41/ld/testsuite/ld-powerpc/tls32.t 2023-08-15 16:49:34.611717013 +0100
@@ -8,5 +8,5 @@
.*
Contents of section \.tdata:
- 1810124 (12345678|78563412) (23456789|89674523) (3456789a|9a785634) (456789ab|ab896745) .*
- 1810134 (56789abc|bc9a7856) (6789abcd|cdab8967) (789abcde|debc9a78) (00c0ffee|eeffc000) .*
+#pass
+
diff -rup binutils.orig/ld/testsuite/ld-powerpc/tls32no.g binutils-2.41/ld/testsuite/ld-powerpc/tls32no.g
--- binutils.orig/ld/testsuite/ld-powerpc/tls32no.g 2023-08-15 17:41:46.719412912 +0100
+++ binutils-2.41/ld/testsuite/ld-powerpc/tls32no.g 2023-08-15 17:42:37.097511729 +0100
@@ -8,6 +8,4 @@
.*
Contents of section \.got:
- 1810144 (0+01 f+8000 0+01 f+803c|010+ 0080f+ 010+ 3c80f+) .*
- 1810154 (0+01 f+8020 f+9030 0+01|010+ 2080f+ 3090f+ 010+) .*
- 1810164 0+ 0+ 0+ 0+0 .*
+#pass
diff -rup binutils.orig/ld/testsuite/ld-srec/srec.exp binutils-2.41/ld/testsuite/ld-srec/srec.exp
--- binutils.orig/ld/testsuite/ld-srec/srec.exp 2024-04-26 16:08:10.098316097 +0100
+++ binutils-2.41/ld/testsuite/ld-srec/srec.exp 2024-04-26 16:10:25.944383297 +0100
@@ -484,6 +484,7 @@ setup_xfail "bfin-*-linux-uclibc"
setup_xfail "tile*-*-*"
setup_xfail "csky*-*-*"
setup_xfail "bpf-*-*"
+setup_xfail "i686-*-*"
run_srec_test $test2 "tmpdir/sr3.o"

View File

@ -0,0 +1,36 @@
diff -rup binutils.orig/ld/ld.1 binutils-2.41/ld/ld.1
--- binutils.orig/ld/ld.1 2023-08-03 12:47:14.427004953 +0100
+++ binutils-2.41/ld/ld.1 2023-08-03 12:49:10.672145873 +0100
@@ -2669,7 +2669,7 @@ systems may not understand them. If you
\&\fB\-\-enable\-new\-dtags\fR, the new dynamic tags will be created as needed
and older dynamic tags will be omitted.
If you specify \fB\-\-disable\-new\-dtags\fR, no new dynamic tags will be
-created. By default, the new dynamic tags are not created. Note that
+created. By default, the new dynamic tags are created. Note that
those options are only available for ELF systems.
.IP \fB\-\-hash\-size=\fR\fInumber\fR 4
.IX Item "--hash-size=number"
diff -rup binutils.orig/ld/ld.info binutils-2.41/ld/ld.info
--- binutils.orig/ld/ld.info 2023-08-03 12:47:14.427004953 +0100
+++ binutils-2.41/ld/ld.info 2023-08-03 12:49:58.829204257 +0100
@@ -2366,7 +2366,7 @@ GNU linker:
--enable-new-dtags, the new dynamic tags will be created as
needed and older dynamic tags will be omitted. If you specify
--disable-new-dtags, no new dynamic tags will be created. By
- default, the new dynamic tags are not created. Note that those
+ default, the new dynamic tags are created. Note that those
options are only available for ELF systems.
--hash-size=NUMBER
diff -rup binutils.orig/ld/ld.texi binutils-2.41/ld/ld.texi
--- binutils.orig/ld/ld.texi 2023-08-03 12:50:58.176276215 +0100
+++ binutils-2.41/ld/ld.texi 2023-08-03 12:41:11.902610960 +0100
@@ -2946,7 +2946,7 @@ systems may not understand them. If you
@option{--enable-new-dtags}, the new dynamic tags will be created as needed
and older dynamic tags will be omitted.
If you specify @option{--disable-new-dtags}, no new dynamic tags will be
-created. By default, the new dynamic tags are not created. Note that
+created. By default, the new dynamic tags are created. Note that
those options are only available for ELF systems.
@kindex --hash-size=@var{number}

View File

@ -0,0 +1,46 @@
diff -rup binutils.orig/bfd/Makefile.am binutils-2.38/bfd/Makefile.am
--- binutils.orig/bfd/Makefile.am 2022-02-09 14:10:42.659300681 +0000
+++ binutils-2.38/bfd/Makefile.am 2022-02-09 14:12:40.562532916 +0000
@@ -977,8 +977,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
$(AM_V_GEN)\
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 ;\
@@ -989,7 +989,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 -rup binutils.orig/bfd/Makefile.in binutils-2.38/bfd/Makefile.in
--- binutils.orig/bfd/Makefile.in 2022-02-09 14:10:42.653300720 +0000
+++ binutils-2.38/bfd/Makefile.in 2022-02-09 14:19:03.362040188 +0000
@@ -2094,8 +2094,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
$(AM_V_GEN)\
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 ;\
@@ -2106,7 +2106,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

View File

@ -0,0 +1,33 @@
diff --git a/ld/testsuite/ld-x86-64/property-3.r b/ld/testsuite/ld-x86-64/property-3.r
index 1bdb47c7b6b..1e4a24c6fbe 100644
--- a/ld/testsuite/ld-x86-64/property-3.r
+++ b/ld/testsuite/ld-x86-64/property-3.r
@@ -4,5 +4,5 @@ Displaying notes found in: .note.gnu.property
GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
Properties: stack size: 0x800000
#...
- x86 ISA needed: x86-64-baseline, x86-64-v2
+ x86 ISA needed: x86-64-baseline, x86-64-v2.*
#pass
diff --git a/ld/testsuite/ld-x86-64/property-4.r b/ld/testsuite/ld-x86-64/property-4.r
index 8cc618cbfad..031a1d280ad 100644
--- a/ld/testsuite/ld-x86-64/property-4.r
+++ b/ld/testsuite/ld-x86-64/property-4.r
@@ -4,5 +4,5 @@ Displaying notes found in: .note.gnu.property
GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
Properties: stack size: 0x800000
#...
- x86 ISA needed: x86-64-baseline, x86-64-v2, x86-64-v4
+ x86 ISA needed: x86-64-baseline, x86-64-v2,.*x86-64-v4
#pass
diff --git a/ld/testsuite/ld-x86-64/property-5.r b/ld/testsuite/ld-x86-64/property-5.r
index e3ba4f659b9..58b274b9772 100644
--- a/ld/testsuite/ld-x86-64/property-5.r
+++ b/ld/testsuite/ld-x86-64/property-5.r
@@ -4,5 +4,5 @@ Displaying notes found in: .note.gnu.property
GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
Properties: stack size: 0x900000
#...
- x86 ISA needed: x86-64-baseline, x86-64-v2, x86-64-v4
+ x86 ISA needed: x86-64-baseline, x86-64-v2,.*x86-64-v4
#pass

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,209 @@
From e30e95759268ce5a5a1f752b3c9fa3e4a182db99 Mon Sep 17 00:00:00 2001
From: Jan Beulich <jbeulich@suse.com>
Date: Fri, 1 Sep 2023 12:28:57 +0200
Subject: [PATCH] x86: correct source used for two non-AVX512 VEXWIG tests
These shouldn't wrongly include the AVX512VL sources. Obviously the
expectations therefore also need to change.
---
gas/testsuite/gas/i386/vaes-wig1.d | 118 ++++-------------------
gas/testsuite/gas/i386/vpclmulqdq-wig1.d | 44 +++------
2 files changed, 32 insertions(+), 130 deletions(-)
diff --git a/gas/testsuite/gas/i386/vaes-wig1.d b/gas/testsuite/gas/i386/vaes-wig1.d
index 8e8567e01df..9d37e52b49e 100644
--- a/gas/testsuite/gas/i386/vaes-wig1.d
+++ b/gas/testsuite/gas/i386/vaes-wig1.d
@@ -1,7 +1,7 @@
#as: -mvexwig=1
#objdump: -dw
#name: i386 AVX/VAES wig insns
-#source: avx512vl_vaes.s
+#source: vaes.s
.*: +file format .*
@@ -9,100 +9,24 @@
Disassembly of section \.text:
00000000 <_start>:
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 de f4[ ]*vaesdec %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 de b4 f4 c0 1d fe ff[ ]*vaesdec -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 de b2 f0 07 00 00[ ]*vaesdec 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 de f4[ ]*vaesdec %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 de b4 f4 c0 1d fe ff[ ]*vaesdec -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 de b2 e0 0f 00 00[ ]*vaesdec 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 df f4[ ]*vaesdeclast %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 df b4 f4 c0 1d fe ff[ ]*vaesdeclast -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 df b2 f0 07 00 00[ ]*vaesdeclast 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 df f4[ ]*vaesdeclast %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 df b4 f4 c0 1d fe ff[ ]*vaesdeclast -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 df b2 e0 0f 00 00[ ]*vaesdeclast 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dc f4[ ]*vaesenc %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dc b4 f4 c0 1d fe ff[ ]*vaesenc -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dc b2 f0 07 00 00[ ]*vaesenc 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dc f4[ ]*vaesenc %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dc b4 f4 c0 1d fe ff[ ]*vaesenc -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dc b2 e0 0f 00 00[ ]*vaesenc 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dd f4[ ]*vaesenclast %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dd b4 f4 c0 1d fe ff[ ]*vaesenclast -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dd b2 f0 07 00 00[ ]*vaesenclast 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dd f4[ ]*vaesenclast %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dd b4 f4 c0 1d fe ff[ ]*vaesenclast -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dd b2 e0 0f 00 00[ ]*vaesenclast 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 de f4[ ]*\{evex\} vaesdec %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 de b4 f4 c0 1d fe ff[ ]*\{evex\} vaesdec -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 de 72 7f[ ]*\{evex\} vaesdec 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 de f4[ ]*\{evex\} vaesdec %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 de b4 f4 c0 1d fe ff[ ]*\{evex\} vaesdec -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 de 72 7f[ ]*\{evex\} vaesdec 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 df f4[ ]*\{evex\} vaesdeclast %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 df b4 f4 c0 1d fe ff[ ]*\{evex\} vaesdeclast -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 df 72 7f[ ]*\{evex\} vaesdeclast 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 df f4[ ]*\{evex\} vaesdeclast %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 df b4 f4 c0 1d fe ff[ ]*\{evex\} vaesdeclast -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 df 72 7f[ ]*\{evex\} vaesdeclast 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dc f4[ ]*\{evex\} vaesenc %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dc b4 f4 c0 1d fe ff[ ]*\{evex\} vaesenc -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dc 72 7f[ ]*\{evex\} vaesenc 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dc f4[ ]*\{evex\} vaesenc %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dc b4 f4 c0 1d fe ff[ ]*\{evex\} vaesenc -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dc 72 7f[ ]*\{evex\} vaesenc 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dd f4[ ]*\{evex\} vaesenclast %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dd b4 f4 c0 1d fe ff[ ]*\{evex\} vaesenclast -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dd 72 7f[ ]*\{evex\} vaesenclast 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dd f4[ ]*\{evex\} vaesenclast %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dd b4 f4 c0 1d fe ff[ ]*\{evex\} vaesenclast -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dd 72 7f[ ]*\{evex\} vaesenclast 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 de f4[ ]*vaesdec %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 de b4 f4 c0 1d fe ff[ ]*vaesdec -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 de b2 f0 07 00 00[ ]*vaesdec 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 de f4[ ]*vaesdec %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 de b4 f4 c0 1d fe ff[ ]*vaesdec -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 de b2 e0 0f 00 00[ ]*vaesdec 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 df f4[ ]*vaesdeclast %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 df b4 f4 c0 1d fe ff[ ]*vaesdeclast -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 df b2 f0 07 00 00[ ]*vaesdeclast 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 df f4[ ]*vaesdeclast %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 df b4 f4 c0 1d fe ff[ ]*vaesdeclast -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 df b2 e0 0f 00 00[ ]*vaesdeclast 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dc f4[ ]*vaesenc %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dc b4 f4 c0 1d fe ff[ ]*vaesenc -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dc b2 f0 07 00 00[ ]*vaesenc 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dc f4[ ]*vaesenc %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dc b4 f4 c0 1d fe ff[ ]*vaesenc -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dc b2 e0 0f 00 00[ ]*vaesenc 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dd f4[ ]*vaesenclast %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dd b4 f4 c0 1d fe ff[ ]*vaesenclast -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d1 dd b2 f0 07 00 00[ ]*vaesenclast 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dd f4[ ]*vaesenclast %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dd b4 f4 c0 1d fe ff[ ]*vaesenclast -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e2 d5 dd b2 e0 0f 00 00[ ]*vaesenclast 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 de f4[ ]*\{evex\} vaesdec %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 de b4 f4 c0 1d fe ff[ ]*\{evex\} vaesdec -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 de 72 7f[ ]*\{evex\} vaesdec 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 de f4[ ]*\{evex\} vaesdec %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 de b4 f4 c0 1d fe ff[ ]*\{evex\} vaesdec -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 de 72 7f[ ]*\{evex\} vaesdec 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 df f4[ ]*\{evex\} vaesdeclast %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 df b4 f4 c0 1d fe ff[ ]*\{evex\} vaesdeclast -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 df 72 7f[ ]*\{evex\} vaesdeclast 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 df f4[ ]*\{evex\} vaesdeclast %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 df b4 f4 c0 1d fe ff[ ]*\{evex\} vaesdeclast -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 df 72 7f[ ]*\{evex\} vaesdeclast 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dc f4[ ]*\{evex\} vaesenc %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dc b4 f4 c0 1d fe ff[ ]*\{evex\} vaesenc -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dc 72 7f[ ]*\{evex\} vaesenc 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dc f4[ ]*\{evex\} vaesenc %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dc b4 f4 c0 1d fe ff[ ]*\{evex\} vaesenc -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dc 72 7f[ ]*\{evex\} vaesenc 0xfe0\(%edx\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dd f4[ ]*\{evex\} vaesenclast %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dd b4 f4 c0 1d fe ff[ ]*\{evex\} vaesenclast -0x1e240\(%esp,%esi,8\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 08 dd 72 7f[ ]*\{evex\} vaesenclast 0x7f0\(%edx\),%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dd f4[ ]*\{evex\} vaesenclast %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dd b4 f4 c0 1d fe ff[ ]*\{evex\} vaesenclast -0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*62 f2 55 28 dd 72 7f[ ]*\{evex\} vaesenclast 0xfe0\(%edx\),%ymm5,%ymm6
+[ ]*[a-f0-9]+: c4 e2 cd dc d4 vaesenc %ymm4,%ymm6,%ymm2
+[ ]*[a-f0-9]+: c4 e2 cd dc 39 vaesenc \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd dd d4 vaesenclast %ymm4,%ymm6,%ymm2
+[ ]*[a-f0-9]+: c4 e2 cd dd 39 vaesenclast \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd de d4 vaesdec %ymm4,%ymm6,%ymm2
+[ ]*[a-f0-9]+: c4 e2 cd de 39 vaesdec \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd df d4 vaesdeclast %ymm4,%ymm6,%ymm2
+[ ]*[a-f0-9]+: c4 e2 cd df 39 vaesdeclast \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd dc d4 vaesenc %ymm4,%ymm6,%ymm2
+[ ]*[a-f0-9]+: c4 e2 cd dc 39 vaesenc \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd dc 39 vaesenc \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd dd d4 vaesenclast %ymm4,%ymm6,%ymm2
+[ ]*[a-f0-9]+: c4 e2 cd dd 39 vaesenclast \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd dd 39 vaesenclast \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd de d4 vaesdec %ymm4,%ymm6,%ymm2
+[ ]*[a-f0-9]+: c4 e2 cd de 39 vaesdec \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd de 39 vaesdec \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd df d4 vaesdeclast %ymm4,%ymm6,%ymm2
+[ ]*[a-f0-9]+: c4 e2 cd df 39 vaesdeclast \(%ecx\),%ymm6,%ymm7
+[ ]*[a-f0-9]+: c4 e2 cd df 39 vaesdeclast \(%ecx\),%ymm6,%ymm7
#pass
diff --git a/gas/testsuite/gas/i386/vpclmulqdq-wig1.d b/gas/testsuite/gas/i386/vpclmulqdq-wig1.d
index 843bf56bc21..52bb1651201 100644
--- a/gas/testsuite/gas/i386/vpclmulqdq-wig1.d
+++ b/gas/testsuite/gas/i386/vpclmulqdq-wig1.d
@@ -1,7 +1,7 @@
#as: -mvexwig=1
#objdump: -dw
#name: i386 AVX/VPCLMULQDQ wig insns
-#source: avx512vl_vpclmulqdq.s
+#source: vpclmulqdq.s
.*: +file format .*
@@ -9,36 +9,14 @@
Disassembly of section \.text:
00000000 <_start>:
-[ ]*[a-f0-9]+:[ ]*c4 e3 e9 44 da ab[ ]*vpclmulqdq \$0xab,%xmm2,%xmm2,%xmm3
-[ ]*[a-f0-9]+:[ ]*c4 e3 e9 44 9c f4 c0 1d fe ff 7b[ ]*vpclmulqdq \$0x7b,-0x1e240\(%esp,%esi,8\),%xmm2,%xmm3
-[ ]*[a-f0-9]+:[ ]*c4 e3 e9 44 9a f0 07 00 00 7b[ ]*vpclmulqdq \$0x7b,0x7f0\(%edx\),%xmm2,%xmm3
-[ ]*[a-f0-9]+:[ ]*c4 e3 d5 44 e1 ab[ ]*vpclmulqdq \$0xab,%ymm1,%ymm5,%ymm4
-[ ]*[a-f0-9]+:[ ]*c4 e3 d5 44 a4 f4 c0 1d fe ff 7b[ ]*vpclmulqdq \$0x7b,-0x1e240\(%esp,%esi,8\),%ymm5,%ymm4
-[ ]*[a-f0-9]+:[ ]*c4 e3 d5 44 a2 e0 0f 00 00 7b[ ]*vpclmulqdq \$0x7b,0xfe0\(%edx\),%ymm5,%ymm4
-[ ]*[a-f0-9]+:[ ]*62 f3 6d 08 44 da ab[ ]*\{evex\} vpclmulqdq \$0xab,%xmm2,%xmm2,%xmm3
-[ ]*[a-f0-9]+:[ ]*62 f3 6d 08 44 9c f4 c0 1d fe ff 7b[ ]*\{evex\} vpclmulqdq \$0x7b,-0x1e240\(%esp,%esi,8\),%xmm2,%xmm3
-[ ]*[a-f0-9]+:[ ]*62 f3 6d 08 44 5a 7f 7b[ ]*\{evex\} vpclmulqdq \$0x7b,0x7f0\(%edx\),%xmm2,%xmm3
-[ ]*[a-f0-9]+:[ ]*62 f3 55 28 44 e1 ab[ ]*\{evex\} vpclmulqdq \$0xab,%ymm1,%ymm5,%ymm4
-[ ]*[a-f0-9]+:[ ]*62 f3 55 28 44 a4 f4 c0 1d fe ff 7b[ ]*\{evex\} vpclmulqdq \$0x7b,-0x1e240\(%esp,%esi,8\),%ymm5,%ymm4
-[ ]*[a-f0-9]+:[ ]*62 f3 55 28 44 62 7f 7b[ ]*\{evex\} vpclmulqdq \$0x7b,0xfe0\(%edx\),%ymm5,%ymm4
-[ ]*[a-f0-9]+:[ ]*62 f3 65 08 44 e2 11[ ]*\{evex\} vpclmulhqhqdq %xmm2,%xmm3,%xmm4
-[ ]*[a-f0-9]+:[ ]*62 f3 5d 08 44 eb 01[ ]*\{evex\} vpclmulhqlqdq %xmm3,%xmm4,%xmm5
-[ ]*[a-f0-9]+:[ ]*62 f3 55 08 44 f4 10[ ]*\{evex\} vpclmullqhqdq %xmm4,%xmm5,%xmm6
-[ ]*[a-f0-9]+:[ ]*62 f3 4d 08 44 fd 00[ ]*\{evex\} vpclmullqlqdq %xmm5,%xmm6,%xmm7
-[ ]*[a-f0-9]+:[ ]*62 f3 6d 28 44 d9 11[ ]*\{evex\} vpclmulhqhqdq %ymm1,%ymm2,%ymm3
-[ ]*[a-f0-9]+:[ ]*62 f3 65 28 44 e2 01[ ]*\{evex\} vpclmulhqlqdq %ymm2,%ymm3,%ymm4
-[ ]*[a-f0-9]+:[ ]*62 f3 5d 28 44 eb 10[ ]*\{evex\} vpclmullqhqdq %ymm3,%ymm4,%ymm5
-[ ]*[a-f0-9]+:[ ]*62 f3 55 28 44 f4 00[ ]*\{evex\} vpclmullqlqdq %ymm4,%ymm5,%ymm6
-[ ]*[a-f0-9]+:[ ]*c4 e3 d1 44 db ab[ ]*vpclmulqdq \$0xab,%xmm3,%xmm5,%xmm3
-[ ]*[a-f0-9]+:[ ]*c4 e3 d1 44 9c f4 c0 1d fe ff 7b[ ]*vpclmulqdq \$0x7b,-0x1e240\(%esp,%esi,8\),%xmm5,%xmm3
-[ ]*[a-f0-9]+:[ ]*c4 e3 d1 44 9a f0 07 00 00 7b[ ]*vpclmulqdq \$0x7b,0x7f0\(%edx\),%xmm5,%xmm3
-[ ]*[a-f0-9]+:[ ]*c4 e3 ed 44 d2 ab[ ]*vpclmulqdq \$0xab,%ymm2,%ymm2,%ymm2
-[ ]*[a-f0-9]+:[ ]*c4 e3 ed 44 94 f4 c0 1d fe ff 7b[ ]*vpclmulqdq \$0x7b,-0x1e240\(%esp,%esi,8\),%ymm2,%ymm2
-[ ]*[a-f0-9]+:[ ]*c4 e3 ed 44 92 e0 0f 00 00 7b[ ]*vpclmulqdq \$0x7b,0xfe0\(%edx\),%ymm2,%ymm2
-[ ]*[a-f0-9]+:[ ]*62 f3 55 08 44 db ab[ ]*\{evex\} vpclmulqdq \$0xab,%xmm3,%xmm5,%xmm3
-[ ]*[a-f0-9]+:[ ]*62 f3 55 08 44 9c f4 c0 1d fe ff 7b[ ]*\{evex\} vpclmulqdq \$0x7b,-0x1e240\(%esp,%esi,8\),%xmm5,%xmm3
-[ ]*[a-f0-9]+:[ ]*62 f3 55 08 44 5a 7f 7b[ ]*\{evex\} vpclmulqdq \$0x7b,0x7f0\(%edx\),%xmm5,%xmm3
-[ ]*[a-f0-9]+:[ ]*62 f3 6d 28 44 d2 ab[ ]*\{evex\} vpclmulqdq \$0xab,%ymm2,%ymm2,%ymm2
-[ ]*[a-f0-9]+:[ ]*62 f3 6d 28 44 94 f4 c0 1d fe ff 7b[ ]*\{evex\} vpclmulqdq \$0x7b,-0x1e240\(%esp,%esi,8\),%ymm2,%ymm2
-[ ]*[a-f0-9]+:[ ]*62 f3 6d 28 44 52 7f 7b[ ]*\{evex\} vpclmulqdq \$0x7b,0xfe0\(%edx\),%ymm2,%ymm2
+[ ]*[a-f0-9]+:[ ]*c4 e3 d5 44 f4 ab[ ]*vpclmulqdq \$0xab,%ymm4,%ymm5,%ymm6
+[ ]*[a-f0-9]+:[ ]*c4 e3 d5 44 b4 f4 c0 1d fe ff 7b[ ]*vpclmulqdq \$0x7b,-0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
+[ ]*[a-f0-9]+:[ ]*c4 e3 d5 44 b2 e0 0f 00 00 7b[ ]*vpclmulqdq \$0x7b,0xfe0\(%edx\),%ymm5,%ymm6
+[ ]*[a-f0-9]+:[ ]*c4 e3 ed 44 d9 11[ ]*vpclmulhqhqdq %ymm1,%ymm2,%ymm3
+[ ]*[a-f0-9]+:[ ]*c4 e3 e5 44 e2 01[ ]*vpclmulhqlqdq %ymm2,%ymm3,%ymm4
+[ ]*[a-f0-9]+:[ ]*c4 e3 dd 44 eb 10[ ]*vpclmullqhqdq %ymm3,%ymm4,%ymm5
+[ ]*[a-f0-9]+:[ ]*c4 e3 d5 44 f4 00[ ]*vpclmullqlqdq %ymm4,%ymm5,%ymm6
+[ ]*[a-f0-9]+:[ ]*c4 e3 d5 44 f4 ab[ ]*vpclmulqdq \$0xab,%ymm4,%ymm5,%ymm6
+[ ]*[a-f0-9]+:[ ]*c4 e3 d5 44 b4 f4 c0 1d fe ff 7b[ ]*vpclmulqdq \$0x7b,-0x1e240\(%esp,%esi,8\),%ymm5,%ymm6
+[ ]*[a-f0-9]+:[ ]*c4 e3 d5 44 b2 e0 0f 00 00 7b[ ]*vpclmulqdq \$0x7b,0xfe0\(%edx\),%ymm5,%ymm6
#pass
--
2.43.0

View File

@ -0,0 +1,379 @@
From dfab07b9ead66f08661325c03175e1df9210ccd7 Mon Sep 17 00:00:00 2001
From: Jan Beulich <jbeulich@suse.com>
Date: Fri, 1 Sep 2023 12:29:44 +0200
Subject: [PATCH] x86: unindent most of set_cpu_arch()
Inverting the initial if()'s condition allows to move out the bulk of
the function by a level, improving readability at least a bit. While
doing that also pull the push/pop handling up first, such that "else if"
after "return" isn't needed anymore; the order in which special cases
are checked doesn't really matter.
---
gas/config/tc-i386.c | 305 ++++++++++++++++++++++---------------------
1 file changed, 154 insertions(+), 151 deletions(-)
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 19a5f2d61e5..00abfc78264 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2793,29 +2793,134 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED)
bool no_cond_jump_promotion;
} arch_stack_entry;
static const arch_stack_entry *arch_stack_top;
+ char *s;
+ int e;
+ const char *string;
+ unsigned int j = 0;
+ i386_cpu_flags flags;
SKIP_WHITESPACE ();
- if (!is_end_of_line[(unsigned char) *input_line_pointer])
+ if (is_end_of_line[(unsigned char) *input_line_pointer])
+ {
+ as_bad (_("missing cpu architecture"));
+ input_line_pointer++;
+ return;
+ }
+
+ e = get_symbol_name (&s);
+ string = s;
+
+ if (strcmp (string, "push") == 0)
+ {
+ arch_stack_entry *top = XNEW (arch_stack_entry);
+
+ top->name = cpu_arch_name;
+ if (cpu_sub_arch_name)
+ top->sub_name = xstrdup (cpu_sub_arch_name);
+ else
+ top->sub_name = NULL;
+ top->flags = cpu_arch_flags;
+ top->isa = cpu_arch_isa;
+ top->isa_flags = cpu_arch_isa_flags;
+ top->flag_code = flag_code;
+ top->stackop_size = stackop_size;
+ top->no_cond_jump_promotion = no_cond_jump_promotion;
+
+ top->prev = arch_stack_top;
+ arch_stack_top = top;
+
+ (void) restore_line_pointer (e);
+ demand_empty_rest_of_line ();
+ return;
+ }
+
+ if (strcmp (string, "pop") == 0)
{
- char *s;
- int e = get_symbol_name (&s);
- const char *string = s;
- unsigned int j = 0;
- i386_cpu_flags flags;
+ const arch_stack_entry *top = arch_stack_top;
- if (strcmp (string, "default") == 0)
+ if (!top)
+ as_bad (_(".arch stack is empty"));
+ else if (top->flag_code != flag_code
+ || top->stackop_size != stackop_size)
+ {
+ static const unsigned int bits[] = {
+ [CODE_16BIT] = 16,
+ [CODE_32BIT] = 32,
+ [CODE_64BIT] = 64,
+ };
+
+ as_bad (_("this `.arch pop' requires `.code%u%s' to be in effect"),
+ bits[top->flag_code],
+ top->stackop_size == LONG_MNEM_SUFFIX ? "gcc" : "");
+ }
+ else
+ {
+ arch_stack_top = top->prev;
+
+ cpu_arch_name = top->name;
+ free (cpu_sub_arch_name);
+ cpu_sub_arch_name = top->sub_name;
+ cpu_arch_flags = top->flags;
+ cpu_arch_isa = top->isa;
+ cpu_arch_isa_flags = top->isa_flags;
+ no_cond_jump_promotion = top->no_cond_jump_promotion;
+
+ XDELETE (top);
+ }
+
+ (void) restore_line_pointer (e);
+ demand_empty_rest_of_line ();
+ return;
+ }
+
+ if (strcmp (string, "default") == 0)
+ {
+ if (strcmp (default_arch, "iamcu") == 0)
+ string = default_arch;
+ else
{
- if (strcmp (default_arch, "iamcu") == 0)
- string = default_arch;
+ static const i386_cpu_flags cpu_unknown_flags = CPU_UNKNOWN_FLAGS;
+
+ cpu_arch_name = NULL;
+ free (cpu_sub_arch_name);
+ cpu_sub_arch_name = NULL;
+ cpu_arch_flags = cpu_unknown_flags;
+ if (flag_code == CODE_64BIT)
+ {
+ cpu_arch_flags.bitfield.cpu64 = 1;
+ cpu_arch_flags.bitfield.cpuno64 = 0;
+ }
else
{
- static const i386_cpu_flags cpu_unknown_flags = CPU_UNKNOWN_FLAGS;
+ cpu_arch_flags.bitfield.cpu64 = 0;
+ cpu_arch_flags.bitfield.cpuno64 = 1;
+ }
+ cpu_arch_isa = PROCESSOR_UNKNOWN;
+ cpu_arch_isa_flags = cpu_arch[flag_code == CODE_64BIT].enable;
+ if (!cpu_arch_tune_set)
+ {
+ cpu_arch_tune = cpu_arch_isa;
+ cpu_arch_tune_flags = cpu_arch_isa_flags;
+ }
+
+ j = ARRAY_SIZE (cpu_arch) + 1;
+ }
+ }
+
+ for (; j < ARRAY_SIZE (cpu_arch); j++)
+ {
+ if (strcmp (string + (*string == '.'), cpu_arch[j].name) == 0
+ && (*string == '.') == (cpu_arch[j].type == PROCESSOR_NONE))
+ {
+ if (*string != '.')
+ {
+ check_cpu_arch_compatible (string, cpu_arch[j].enable);
- cpu_arch_name = NULL;
+ cpu_arch_name = cpu_arch[j].name;
free (cpu_sub_arch_name);
cpu_sub_arch_name = NULL;
- cpu_arch_flags = cpu_unknown_flags;
+ cpu_arch_flags = cpu_arch[j].enable;
if (flag_code == CODE_64BIT)
{
cpu_arch_flags.bitfield.cpu64 = 1;
@@ -2826,173 +2931,71 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED)
cpu_arch_flags.bitfield.cpu64 = 0;
cpu_arch_flags.bitfield.cpuno64 = 1;
}
- cpu_arch_isa = PROCESSOR_UNKNOWN;
- cpu_arch_isa_flags = cpu_arch[flag_code == CODE_64BIT].enable;
+ cpu_arch_isa = cpu_arch[j].type;
+ cpu_arch_isa_flags = cpu_arch[j].enable;
if (!cpu_arch_tune_set)
{
cpu_arch_tune = cpu_arch_isa;
cpu_arch_tune_flags = cpu_arch_isa_flags;
}
-
- j = ARRAY_SIZE (cpu_arch) + 1;
+ pre_386_16bit_warned = false;
+ break;
}
- }
- else if (strcmp (string, "push") == 0)
- {
- arch_stack_entry *top = XNEW (arch_stack_entry);
- top->name = cpu_arch_name;
- if (cpu_sub_arch_name)
- top->sub_name = xstrdup (cpu_sub_arch_name);
- else
- top->sub_name = NULL;
- top->flags = cpu_arch_flags;
- top->isa = cpu_arch_isa;
- top->isa_flags = cpu_arch_isa_flags;
- top->flag_code = flag_code;
- top->stackop_size = stackop_size;
- top->no_cond_jump_promotion = no_cond_jump_promotion;
+ if (cpu_flags_all_zero (&cpu_arch[j].enable))
+ continue;
- top->prev = arch_stack_top;
- arch_stack_top = top;
+ flags = cpu_flags_or (cpu_arch_flags, cpu_arch[j].enable);
- (void) restore_line_pointer (e);
- demand_empty_rest_of_line ();
- return;
- }
- else if (strcmp (string, "pop") == 0)
- {
- const arch_stack_entry *top = arch_stack_top;
-
- if (!top)
- as_bad (_(".arch stack is empty"));
- else if (top->flag_code != flag_code
- || top->stackop_size != stackop_size)
+ if (!cpu_flags_equal (&flags, &cpu_arch_flags))
{
- static const unsigned int bits[] = {
- [CODE_16BIT] = 16,
- [CODE_32BIT] = 32,
- [CODE_64BIT] = 64,
- };
-
- as_bad (_("this `.arch pop' requires `.code%u%s' to be in effect"),
- bits[top->flag_code],
- top->stackop_size == LONG_MNEM_SUFFIX ? "gcc" : "");
+ extend_cpu_sub_arch_name (string + 1);
+ cpu_arch_flags = flags;
+ cpu_arch_isa_flags = flags;
}
else
- {
- arch_stack_top = top->prev;
-
- cpu_arch_name = top->name;
- free (cpu_sub_arch_name);
- cpu_sub_arch_name = top->sub_name;
- cpu_arch_flags = top->flags;
- cpu_arch_isa = top->isa;
- cpu_arch_isa_flags = top->isa_flags;
- no_cond_jump_promotion = top->no_cond_jump_promotion;
-
- XDELETE (top);
- }
+ cpu_arch_isa_flags
+ = cpu_flags_or (cpu_arch_isa_flags, cpu_arch[j].enable);
(void) restore_line_pointer (e);
demand_empty_rest_of_line ();
return;
}
+ }
- for (; j < ARRAY_SIZE (cpu_arch); j++)
- {
- if (strcmp (string + (*string == '.'), cpu_arch[j].name) == 0
- && (*string == '.') == (cpu_arch[j].type == PROCESSOR_NONE))
- {
- if (*string != '.')
- {
- check_cpu_arch_compatible (string, cpu_arch[j].enable);
-
- cpu_arch_name = cpu_arch[j].name;
- free (cpu_sub_arch_name);
- cpu_sub_arch_name = NULL;
- cpu_arch_flags = cpu_arch[j].enable;
- if (flag_code == CODE_64BIT)
- {
- cpu_arch_flags.bitfield.cpu64 = 1;
- cpu_arch_flags.bitfield.cpuno64 = 0;
- }
- else
- {
- cpu_arch_flags.bitfield.cpu64 = 0;
- cpu_arch_flags.bitfield.cpuno64 = 1;
- }
- cpu_arch_isa = cpu_arch[j].type;
- cpu_arch_isa_flags = cpu_arch[j].enable;
- if (!cpu_arch_tune_set)
- {
- cpu_arch_tune = cpu_arch_isa;
- cpu_arch_tune_flags = cpu_arch_isa_flags;
- }
- pre_386_16bit_warned = false;
- break;
- }
-
- if (cpu_flags_all_zero (&cpu_arch[j].enable))
- continue;
-
- flags = cpu_flags_or (cpu_arch_flags,
- cpu_arch[j].enable);
-
- if (!cpu_flags_equal (&flags, &cpu_arch_flags))
- {
- extend_cpu_sub_arch_name (string + 1);
- cpu_arch_flags = flags;
- cpu_arch_isa_flags = flags;
- }
- else
- cpu_arch_isa_flags
- = cpu_flags_or (cpu_arch_isa_flags,
- cpu_arch[j].enable);
- (void) restore_line_pointer (e);
- demand_empty_rest_of_line ();
- return;
- }
- }
-
- if (startswith (string, ".no") && j >= ARRAY_SIZE (cpu_arch))
- {
- /* Disable an ISA extension. */
- for (j = 0; j < ARRAY_SIZE (cpu_arch); j++)
- if (cpu_arch[j].type == PROCESSOR_NONE
- && strcmp (string + 3, cpu_arch[j].name) == 0)
+ if (startswith (string, ".no") && j >= ARRAY_SIZE (cpu_arch))
+ {
+ /* Disable an ISA extension. */
+ for (j = 0; j < ARRAY_SIZE (cpu_arch); j++)
+ if (cpu_arch[j].type == PROCESSOR_NONE
+ && strcmp (string + 3, cpu_arch[j].name) == 0)
+ {
+ flags = cpu_flags_and_not (cpu_arch_flags, cpu_arch[j].disable);
+ if (!cpu_flags_equal (&flags, &cpu_arch_flags))
{
- flags = cpu_flags_and_not (cpu_arch_flags,
- cpu_arch[j].disable);
- if (!cpu_flags_equal (&flags, &cpu_arch_flags))
- {
- extend_cpu_sub_arch_name (string + 1);
- cpu_arch_flags = flags;
- cpu_arch_isa_flags = flags;
- }
- (void) restore_line_pointer (e);
- demand_empty_rest_of_line ();
- return;
+ extend_cpu_sub_arch_name (string + 1);
+ cpu_arch_flags = flags;
+ cpu_arch_isa_flags = flags;
}
- }
-
- if (j == ARRAY_SIZE (cpu_arch))
- as_bad (_("no such architecture: `%s'"), string);
- *input_line_pointer = e;
+ (void) restore_line_pointer (e);
+ demand_empty_rest_of_line ();
+ return;
+ }
}
- else
- as_bad (_("missing cpu architecture"));
+
+ if (j == ARRAY_SIZE (cpu_arch))
+ as_bad (_("no such architecture: `%s'"), string);
+
+ *input_line_pointer = e;
no_cond_jump_promotion = 0;
if (*input_line_pointer == ','
&& !is_end_of_line[(unsigned char) input_line_pointer[1]])
{
- char *string;
- char e;
-
++input_line_pointer;
- e = get_symbol_name (&string);
+ e = get_symbol_name (&s);
+ string = s;
if (strcmp (string, "nojumps") == 0)
no_cond_jump_promotion = 1;
--
2.43.0

View File

@ -0,0 +1,160 @@
diff -rup fred/gas/config/tc-i386.c binutils-2.41/gas/config/tc-i386.c
--- fred/gas/config/tc-i386.c 2023-12-07 10:00:21.013005830 +0000
+++ binutils-2.41/gas/config/tc-i386.c 2023-12-07 10:00:28.037015037 +0000
@@ -1053,8 +1053,8 @@ static const arch_entry cpu_arch[] =
SUBARCH (xsavec, XSAVEC, ANY_XSAVEC, false),
SUBARCH (xsaves, XSAVES, ANY_XSAVES, false),
SUBARCH (aes, AES, ANY_AES, false),
- SUBARCH (pclmul, PCLMUL, ANY_PCLMUL, false),
- SUBARCH (clmul, PCLMUL, ANY_PCLMUL, true),
+ SUBARCH (pclmul, PCLMULQDQ, ANY_PCLMULQDQ, false),
+ SUBARCH (clmul, PCLMULQDQ, ANY_PCLMULQDQ, true),
SUBARCH (fsgsbase, FSGSBASE, FSGSBASE, false),
SUBARCH (rdrnd, RDRND, RDRND, false),
SUBARCH (f16c, F16C, ANY_F16C, false),
@@ -1861,7 +1861,7 @@ cpu_flags_match (const insn_template *t)
|| (sse2avx && !i.prefix[DATA_PREFIX]))
&& (!x.bitfield.cpuaes || cpu.bitfield.cpuaes)
&& (!x.bitfield.cpugfni || cpu.bitfield.cpugfni)
- && (!x.bitfield.cpupclmul || cpu.bitfield.cpupclmul))
+ && (!x.bitfield.cpupclmulqdq || cpu.bitfield.cpupclmulqdq))
match |= CPU_FLAGS_ARCH_MATCH;
}
else if (x.bitfield.cpuavx512f)
diff -rup fred/opcodes/i386-gen.c binutils-2.41/opcodes/i386-gen.c
--- fred/opcodes/i386-gen.c 2023-12-07 10:00:22.092007244 +0000
+++ binutils-2.41/opcodes/i386-gen.c 2023-12-07 10:00:28.038015039 +0000
@@ -79,7 +79,7 @@ static const dependency isa_dependencies
{ "AMDFAM10",
"K8|FISTTP|SSE4A|ABM|MONITOR" },
{ "BDVER1",
- "GENERIC64|FISTTP|Rdtscp|MONITOR|CX16|LAHF_SAHF|XOP|ABM|LWP|SVME|AES|PCLMUL|PRFCHW" },
+ "GENERIC64|FISTTP|Rdtscp|MONITOR|CX16|LAHF_SAHF|XOP|ABM|LWP|SVME|AES|PCLMULQDQ|PRFCHW" },
{ "BDVER2",
"BDVER1|FMA|BMI|TBM|F16C" },
{ "BDVER3",
@@ -87,7 +87,7 @@ static const dependency isa_dependencies
{ "BDVER4",
"BDVER3|AVX2|Movbe|BMI2|RdRnd|MWAITX" },
{ "ZNVER1",
- "GENERIC64|FISTTP|Rdtscp|MONITOR|CX16|LAHF_SAHF|AVX2|SSE4A|ABM|SVME|AES|PCLMUL|PRFCHW|FMA|BMI|F16C|Xsaveopt|FSGSBase|Movbe|BMI2|RdRnd|ADX|RdSeed|SMAP|SHA|XSAVEC|XSAVES|ClflushOpt|CLZERO|MWAITX" },
+ "GENERIC64|FISTTP|Rdtscp|MONITOR|CX16|LAHF_SAHF|AVX2|SSE4A|ABM|SVME|AES|PCLMULQDQ|PRFCHW|FMA|BMI|F16C|Xsaveopt|FSGSBase|Movbe|BMI2|RdRnd|ADX|RdSeed|SMAP|SHA|XSAVEC|XSAVES|ClflushOpt|CLZERO|MWAITX" },
{ "ZNVER2",
"ZNVER1|CLWB|RDPID|RDPRU|MCOMMIT|WBNOINVD" },
{ "ZNVER3",
@@ -97,7 +97,7 @@ static const dependency isa_dependencies
{ "BTVER1",
"GENERIC64|FISTTP|MONITOR|CX16|LAHF_SAHF|Rdtscp|SSSE3|SSE4A|ABM|PRFCHW|Clflush|FISTTP|SVME" },
{ "BTVER2",
- "BTVER1|AVX|BMI|F16C|AES|PCLMUL|Movbe|Xsaveopt|PRFCHW" },
+ "BTVER1|AVX|BMI|F16C|AES|PCLMULQDQ|Movbe|Xsaveopt|PRFCHW" },
{ "286",
"186" },
{ "386",
@@ -132,7 +132,7 @@ static const dependency isa_dependencies
"XSAVE" },
{ "AES",
"SSE2" },
- { "PCLMUL",
+ { "PCLMULQDQ",
"SSE2" },
{ "FMA",
"AVX" },
@@ -307,7 +307,7 @@ static bitfield cpu_flags[] =
BITFIELD (Xsave),
BITFIELD (Xsaveopt),
BITFIELD (AES),
- BITFIELD (PCLMUL),
+ BITFIELD (PCLMULQDQ),
BITFIELD (FMA),
BITFIELD (FMA4),
BITFIELD (XOP),
diff -rup fred/opcodes/i386-init.h binutils-2.41/opcodes/i386-init.h
--- fred/opcodes/i386-init.h 2023-12-07 10:00:22.092007244 +0000
+++ binutils-2.41/opcodes/i386-init.h 2023-12-07 10:00:51.260045479 +0000
@@ -432,7 +432,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, 0, 0, 0, 0, 0, 0, 0, 0 } }
-#define CPU_PCLMUL_FLAGS \
+#define CPU_PCLMULQDQ_FLAGS \
{ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
@@ -1791,7 +1791,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, 0, 0, 0, 0, 0, 0, 0, 0 } }
-#define CPU_ANY_PCLMUL_FLAGS \
+#define CPU_ANY_PCLMULQDQ_FLAGS \
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 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, \
diff -rup fred/opcodes/i386-opc.h binutils-2.41/opcodes/i386-opc.h
--- fred/opcodes/i386-opc.h 2023-12-07 10:00:22.093007246 +0000
+++ binutils-2.41/opcodes/i386-opc.h 2023-12-07 10:00:28.038015039 +0000
@@ -121,8 +121,8 @@ enum
CpuXsaveopt,
/* AES support required */
CpuAES,
- /* PCLMUL support required */
- CpuPCLMUL,
+ /* PCLMULQDQ support required */
+ CpuPCLMULQDQ,
/* FMA support required */
CpuFMA,
/* FMA4 support required */
@@ -374,7 +374,7 @@ typedef union i386_cpu_flags
unsigned int cpuxsave:1;
unsigned int cpuxsaveopt:1;
unsigned int cpuaes:1;
- unsigned int cpupclmul:1;
+ unsigned int cpupclmulqdq:1;
unsigned int cpufma:1;
unsigned int cpufma4:1;
unsigned int cpuxop:1;
diff -rup fred/opcodes/i386-opc.tbl binutils-2.41/opcodes/i386-opc.tbl
--- fred/opcodes/i386-opc.tbl 2023-12-07 10:00:22.093007246 +0000
+++ binutils-2.41/opcodes/i386-opc.tbl 2023-12-07 10:00:28.038015039 +0000
@@ -1448,15 +1448,15 @@ vaesdeclast, 0x66df, VAES, Modrm|Vex256|
vaesenc, 0x66dc, VAES, Modrm|Vex256|Space0F38|VexVVVV|VexWIG|NoSuf, { RegYMM|Unspecified|BaseIndex, RegYMM, RegYMM }
vaesenclast, 0x66dd, VAES, Modrm|Vex256|Space0F38|VexVVVV|VexWIG|NoSuf, { RegYMM|Unspecified|BaseIndex, RegYMM, RegYMM }
-// PCLMUL
+// PCLMULQDQ
<pclmul:cpu:attr, $avx:AVX|:Vex128|VexW0|SSE2AVX|VexVVVV, $sse::>
-pclmulqdq<pclmul>, 0x660f3a44, <pclmul:cpu>PCLMUL, Modrm|<pclmul:attr>|NoSuf, { Imm8|Imm8S, RegXMM|Unspecified|BaseIndex, RegXMM }
-pclmullqlqdq<pclmul>, 0x660f3a44/0x00, <pclmul:cpu>PCLMUL, Modrm|<pclmul:attr>|NoSuf|ImmExt, { RegXMM|Unspecified|BaseIndex, RegXMM }
-pclmulhqlqdq<pclmul>, 0x660f3a44/0x01, <pclmul:cpu>PCLMUL, Modrm|<pclmul:attr>|NoSuf|ImmExt, { RegXMM|Unspecified|BaseIndex, RegXMM }
-pclmullqhqdq<pclmul>, 0x660f3a44/0x10, <pclmul:cpu>PCLMUL, Modrm|<pclmul:attr>|NoSuf|ImmExt, { RegXMM|Unspecified|BaseIndex, RegXMM }
-pclmulhqhqdq<pclmul>, 0x660f3a44/0x11, <pclmul:cpu>PCLMUL, Modrm|<pclmul:attr>|NoSuf|ImmExt, { RegXMM|Unspecified|BaseIndex, RegXMM }
+pclmulqdq<pclmul>, 0x660f3a44, <pclmul:cpu>PCLMULQDQ, Modrm|<pclmul:attr>|NoSuf, { Imm8|Imm8S, RegXMM|Unspecified|BaseIndex, RegXMM }
+pclmullqlqdq<pclmul>, 0x660f3a44/0x00, <pclmul:cpu>PCLMULQDQ, Modrm|<pclmul:attr>|NoSuf|ImmExt, { RegXMM|Unspecified|BaseIndex, RegXMM }
+pclmulhqlqdq<pclmul>, 0x660f3a44/0x01, <pclmul:cpu>PCLMULQDQ, Modrm|<pclmul:attr>|NoSuf|ImmExt, { RegXMM|Unspecified|BaseIndex, RegXMM }
+pclmullqhqdq<pclmul>, 0x660f3a44/0x10, <pclmul:cpu>PCLMULQDQ, Modrm|<pclmul:attr>|NoSuf|ImmExt, { RegXMM|Unspecified|BaseIndex, RegXMM }
+pclmulhqhqdq<pclmul>, 0x660f3a44/0x11, <pclmul:cpu>PCLMULQDQ, Modrm|<pclmul:attr>|NoSuf|ImmExt, { RegXMM|Unspecified|BaseIndex, RegXMM }
// GFNI
@@ -1771,13 +1771,13 @@ vaesenclast, 0x66dd, AVX|AES, Modrm|Vex|
vaesimc, 0x66db, AVX|AES, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM }
vaeskeygenassist, 0x66df, AVX|AES, Modrm|Vex|Space0F3A|VexWIG|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM }
-// PCLMUL + AVX
+// PCLMULQDQ + AVX
-vpclmulqdq, 0x6644, AVX|PCLMUL, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
-vpclmullqlqdq, 0x6644/0x00, AVX|PCLMUL, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
-vpclmulhqlqdq, 0x6644/0x01, AVX|PCLMUL, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
-vpclmullqhqdq, 0x6644/0x10, AVX|PCLMUL, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
-vpclmulhqhqdq, 0x6644/0x11, AVX|PCLMUL, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
+vpclmulqdq, 0x6644, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
+vpclmullqlqdq, 0x6644/0x00, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
+vpclmulhqlqdq, 0x6644/0x01, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
+vpclmullqhqdq, 0x6644/0x10, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
+vpclmulhqhqdq, 0x6644/0x11, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM }
// GFNI + AVX

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
%global __python /usr/bin/python3
%{?scl_package:%global scl gcc-toolset-14}
%global scl_prefix gcc-toolset-14-
BuildRequires: scl-utils-build
%{?scl:%scl_package gcc}
Summary: DWARF optimization and duplicate removal tool
Name: %{?scl_prefix}dwz
Version: 0.14
Release: 0%{?dist}
License: GPLv2+ and GPLv3+
# git archive --format=tar --remote=git://sourceware.org/git/dwz.git \
# --prefix=dwz-%%{version}/ dwz-%%{version} \
# | bzip2 -9 > dwz-%%{version}.tar.bz2
Source: dwz-%{version}.tar.xz
BuildRequires: gcc, gcc-c++, gdb, elfutils-libelf-devel, dejagnu
BuildRequires: make
%{?scl:Requires:%scl_runtime}
%description
The dwz package contains a program that attempts to optimize DWARF
debugging information contained in ELF shared libraries and ELF executables
for size, by replacing DWARF information representation with equivalent
smaller representation where possible and by reducing the amount of
duplication using techniques from DWARF standard appendix E - creating
DW_TAG_partial_unit compilation units (CUs) for duplicated information
and using DW_TAG_imported_unit to import it into each CU that needs it.
%prep
%setup -q -n dwz
%build
%make_build CFLAGS='%{optflags}' LDFLAGS='%{build_ldflags}' \
prefix=%{_prefix} mandir=%{_mandir} bindir=%{_bindir}
%install
rm -rf %{buildroot}
%make_install prefix=%{_prefix} mandir=%{_mandir} bindir=%{_bindir}
%check
make check
%files
%license COPYING COPYING3 COPYING.RUNTIME
%{_bindir}/dwz
%{_mandir}/man1/dwz.1*
%changelog
* Mon Apr 29 2024 Marek Polacek <polacek@redhat.com> 0.14-0
- new package (RHEL-29852)

View File

@ -0,0 +1,85 @@
From 8a7f364afd86a4c4c2c747ae9cb4216fe992acc8 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Wed, 25 Aug 2021 12:36:42 -0400
Subject: [PATCH 01/17] basic_string::reserve(n) semantics are not available in
DTS
Various tests were added upstream 2020-08-06 as part of:
"libstdc++: Implement P0966 std::string::reserve should not shrink"
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=140cf935cd118f7208b7c3826a8b9d50936242f0
std::string and std::wstring are instantiated in the system libstdc++.so
via explicit instantiation definitions, so the new basic_string::reserve(n)
semantics are not available in DTS.
Update/disable the pertinent parts of the tests to reflect the behavior
when run against the system libstdc++.so.
---
.../testsuite/21_strings/basic_string/capacity/char/1.cc | 6 ------
.../21_strings/basic_string/capacity/char/18654.cc | 2 +-
.../testsuite/21_strings/basic_string/capacity/wchar_t/1.cc | 6 ------
.../21_strings/basic_string/capacity/wchar_t/18654.cc | 2 +-
4 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
index eea69771f..64187718d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
@@ -41,12 +41,6 @@ void test01()
sz01 = str01.capacity();
VERIFY( sz01 < sz02 );
- // P0966: reserve should not shrink
- str01.reserve(100);
- sz01 = str01.capacity();
- str01.reserve(sz01 - 1);
- VERIFY( str01.capacity() == sz01 );
-
sz01 = str01.size() + 5;
str01.resize(sz01);
sz02 = str01.size();
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
index 02ce78ea6..3a7352123 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
@@ -51,7 +51,7 @@ void test01()
VERIFY( cap >= 3 * i );
str.reserve(2 * i);
- VERIFY( str.capacity() == cap );
+ VERIFY( str.capacity() == 2 * i );
#if __cplusplus <= 201703L
str.reserve();
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
index f01a27e8c..70915a94d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
@@ -41,12 +41,6 @@ void test01()
sz01 = str01.capacity();
VERIFY( sz01 < sz02 );
- // P0966: reserve should not shrink
- str01.reserve(100);
- sz01 = str01.capacity();
- str01.reserve(sz01 - 1);
- VERIFY( str01.capacity() == sz01 );
-
sz01 = str01.size() + 5;
str01.resize(sz01);
sz02 = str01.size();
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
index 267fd198b..c9711a294 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
@@ -51,7 +51,7 @@ void test01()
VERIFY( cap >= 3 * i );
str.reserve(2 * i);
- VERIFY( str.capacity() == cap );
+ VERIFY( str.capacity() == 2 * i );
#if __cplusplus <= 201703L
str.reserve();
--
2.31.1

View File

@ -0,0 +1,46 @@
From d7fae9f17479c44dae68483d457fc3fbb58c4b83 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Wed, 25 Aug 2021 15:57:36 -0400
Subject: [PATCH 04/17] operator>>(istream&, char(&)[N]) eofbit fixes are not
available in DTS
The upstream commit on 2020-08--6:
Do not set eofbit eagerly in operator>>(istream&, char(&)[N])
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=4e39f563c0cd25401f689c2093cb8c13692156ef
altered the behaviour of std::istream symbols defined in libstdc++.so,
but with DTS you get the old definitions from the system libstdc++.so
Hence this patch tweaks the new tests to avoid failing when run against
the system libstdc++.so
---
.../21_strings/basic_string/inserters_extractors/char/13.cc | 1 -
.../21_strings/basic_string/inserters_extractors/wchar_t/13.cc | 1 -
2 files changed, 2 deletions(-)
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/13.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/13.cc
index a25d8a93d..7d85e6ead 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/13.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/13.cc
@@ -29,7 +29,6 @@ test01()
std::string buf;
in.width(4);
in >> buf;
- VERIFY( !in.eof() ); // should stop after reading 4 chars
VERIFY( buf == str );
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/13.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/13.cc
index f15294a44..fa5fe3d4a 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/13.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/13.cc
@@ -29,7 +29,6 @@ test01()
std::wstring buf;
in.width(4);
in >> buf;
- VERIFY( !in.eof() ); // should stop after reading 4 chars
VERIFY( buf == str );
}
--
2.31.1

View File

@ -0,0 +1,53 @@
From 3ede89bd19328c26bcd881b873cf4a766ae0da3a Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Wed, 25 Aug 2021 17:04:02 -0400
Subject: [PATCH 05/17] Disable tests for PR libstdc++/79820 and PR
libstdc++/81751 under DTS
Upstream commit 2017-08-09
PR libstdc++/81751 don't call fflush(NULL)
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=04d07b61cb80fd97e98eb39451ff6a8675a63d90
added these test cases as part of verifying the behavior of sys_open (that
it resets errno and doesn't call fflush on NULL).
These symbols are in the system stdlib when run from DTS and thus aren't
fixed by the above change:
1521: 000000000007c430 104 FUNC GLOBAL DEFAULT 12 std::__basic_file<char>::sys_open(int, std::_Ios_Openmode)@@GLIBCXX_3.4
2895: 000000000007c730 95 FUNC GLOBAL DEFAULT 12 std::__basic_file<char>::sys_open(_IO_FILE*, std::_Ios_Openmode)@@GLIBCXX_3.4
This patch disables the non-fixed assertions.
---
libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc | 2 --
libstdc++-v3/testsuite/ext/stdio_filebuf/char/81751.cc | 1 -
2 files changed, 3 deletions(-)
diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc
index 278b99169..e2a8e3b3d 100644
--- a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc
@@ -26,9 +26,7 @@ void
test01()
{
FILE* f = std::fopen("79820.txt", "w");
- errno = 127;
__gnu_cxx::stdio_filebuf<char> b(f, std::ios::out, BUFSIZ);
- VERIFY(errno == 127); // PR libstdc++/79820
b.close();
std::fclose(f);
}
diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/81751.cc b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/81751.cc
index 21aa06f78..6a231d7cf 100644
--- a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/81751.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/81751.cc
@@ -31,7 +31,6 @@ test01()
FILE* in1 = std::fopen("81751.txt", "r");
__gnu_cxx::stdio_filebuf<char> buf1(in1, std::ios::in, BUFSIZ);
int c = buf1.sgetc();
- VERIFY( c == std::char_traits<char>::eof() ); // PR libstdc++/81751
std::fflush(out);
FILE* in2 = std::fopen("81751.txt", "r");
--
2.31.1

View File

@ -0,0 +1,118 @@
From 59388ee3dac5c737086ed1f83f552a44481a2213 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 31 Aug 2021 16:08:57 -0400
Subject: [PATCH 06/17] Don't assume has_facet<codecvt_c16> when run against
system libstdc++
Upstream commit 2019-02-19:
P0482R5 char8_t: Standard library support
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=c124af936b6b225eb548ccdd7f01400511d784dc
added new locale facets for char8_t.
has_facet<codecvt_c16> returns false, as it is using the std::locale the system libstdc++:
$ eu-readelf -s char16_t-char8_t.exe |c++filt |grep UNDEF|grep locale
3: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::locale::classic()@GLIBCXX_3.4 (2)
8: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::locale::locale(std::locale const&)@GLIBCXX_3.4 (2)
13: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::locale::id::_M_id() const@GLIBCXX_3.4 (2)
22: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::locale::~locale()@GLIBCXX_3.4 (2)
64: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::locale::classic()@@GLIBCXX_3.4
76: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::locale::locale(std::locale const&)@@GLIBCXX_3.4
89: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::locale::id::_M_id() const@@GLIBCXX_3.4
108: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::locale::~locale()@@GLIBCXX_3.4
Hence this patch tweaks tests so that they bail out if run against an older std::locale.
---
libstdc++-v3/testsuite/22_locale/codecvt/char16_t-char8_t.cc | 3 ++-
libstdc++-v3/testsuite/22_locale/codecvt/char16_t.cc | 3 ++-
libstdc++-v3/testsuite/22_locale/codecvt/char32_t-char8_t.cc | 3 ++-
libstdc++-v3/testsuite/22_locale/codecvt/char32_t.cc | 3 ++-
libstdc++-v3/testsuite/22_locale/codecvt/utf8-char8_t.cc | 2 ++
libstdc++-v3/testsuite/22_locale/codecvt/utf8.cc | 2 ++
6 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/char16_t-char8_t.cc b/libstdc++-v3/testsuite/22_locale/codecvt/char16_t-char8_t.cc
index 71a23bef4..d4aa519a2 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/char16_t-char8_t.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/char16_t-char8_t.cc
@@ -31,7 +31,8 @@ test01()
using namespace std;
typedef codecvt<char16_t, char8_t, mbstate_t> codecvt_c16;
locale loc_c = locale::classic();
- VERIFY(has_facet<codecvt_c16>(loc_c));
+ if (!has_facet<codecvt_c16>(loc_c))
+ return;
const codecvt_c16* const cvt = &use_facet<codecvt_c16>(loc_c);
VERIFY(!cvt->always_noconv());
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/char16_t.cc b/libstdc++-v3/testsuite/22_locale/codecvt/char16_t.cc
index 7b5ce126d..05c77b2b1 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/char16_t.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/char16_t.cc
@@ -29,7 +29,8 @@ test01()
using namespace std;
typedef codecvt<char16_t, char, mbstate_t> codecvt_c16;
locale loc_c = locale::classic();
- VERIFY(has_facet<codecvt_c16>(loc_c));
+ if (!has_facet<codecvt_c16>(loc_c))
+ return;
const codecvt_c16* const cvt = &use_facet<codecvt_c16>(loc_c);
VERIFY(!cvt->always_noconv());
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/char32_t-char8_t.cc b/libstdc++-v3/testsuite/22_locale/codecvt/char32_t-char8_t.cc
index f30ae22e9..281969e9b 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/char32_t-char8_t.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/char32_t-char8_t.cc
@@ -33,7 +33,8 @@ test01()
using namespace std;
typedef codecvt<char32_t, char8_t, mbstate_t> codecvt_c32;
locale loc_c = locale::classic();
- VERIFY(has_facet<codecvt_c32>(loc_c));
+ if (!has_facet<codecvt_c32>(loc_c))
+ return;
const codecvt_c32* const cvt = &use_facet<codecvt_c32>(loc_c);
VERIFY(!cvt->always_noconv());
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/char32_t.cc b/libstdc++-v3/testsuite/22_locale/codecvt/char32_t.cc
index 558ba9145..82980b702 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/char32_t.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/char32_t.cc
@@ -31,7 +31,8 @@ test01()
using namespace std;
typedef codecvt<char32_t, char, mbstate_t> codecvt_c32;
locale loc_c = locale::classic();
- VERIFY(has_facet<codecvt_c32>(loc_c));
+ if (!has_facet<codecvt_c32>(loc_c))
+ return;
const codecvt_c32* const cvt = &use_facet<codecvt_c32>(loc_c);
VERIFY(!cvt->always_noconv());
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/utf8-char8_t.cc b/libstdc++-v3/testsuite/22_locale/codecvt/utf8-char8_t.cc
index 5eab05ba2..d6f663ce6 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/utf8-char8_t.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/utf8-char8_t.cc
@@ -34,6 +34,8 @@ void test(const C* from)
std::mbstate_t state{};
char8_t buf[16] = { };
using test_type = std::codecvt<C, char8_t, std::mbstate_t>;
+ if (!std::has_facet<test_type>(std::locale::classic()))
+ return;
const test_type& cvt = std::use_facet<test_type>(std::locale::classic());
auto from_end = from + len;
auto from_next = from;
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/utf8.cc b/libstdc++-v3/testsuite/22_locale/codecvt/utf8.cc
index b1b3cff31..167bc0ca3 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/utf8.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/utf8.cc
@@ -32,6 +32,8 @@ void test(const C* from)
std::mbstate_t state{};
char buf[16] = { };
using test_type = std::codecvt<C, char, std::mbstate_t>;
+ if (!std::has_facet<test_type>(std::locale::classic()))
+ return;
const test_type& cvt = std::use_facet<test_type>(std::locale::classic());
auto from_end = from + len;
auto from_next = from;
--
2.31.1

View File

@ -0,0 +1,42 @@
From 16694079a3f415f5e5683b0afe6978810ac259b1 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 31 Aug 2021 17:01:05 -0400
Subject: [PATCH 08/17] testsuite: build plugins with -std=c++11
Various testsuite plugins fail when built within DTS with e.g.:
cc1: error: cannot load plugin ./diagnostic_plugin_test_paths.so: /builddir/build/BUILD/gcc-11.1.1-20210623/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/src/.libs/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./diagnostic_plugin_test_paths.so)
These turn out to C++14's sized deletion
(see https://en.cppreference.com/w/cpp/memory/new/operator_delete):
14: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF _ZdlPvm@CXXABI_1.3.9 (4)
48: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF _ZdlPvm@CXXABI_1.3.9
14: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF operator delete(void*, unsigned long)@CXXABI_1.3.9 (4)
48: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF operator delete(void*, unsigned long)@CXXABI_1.3.9
Looks like plugin.exp is building the test plugins against the
freshly-built libstdc++, and then trying to dynamically load them
against the system libstdc++.
This patch forces the use of -std=c++11 when building these test plugins,
to sidestep the problem.
---
gcc/testsuite/lib/plugin-support.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/testsuite/lib/plugin-support.exp b/gcc/testsuite/lib/plugin-support.exp
index 6d651901e..9943dbb37 100644
--- a/gcc/testsuite/lib/plugin-support.exp
+++ b/gcc/testsuite/lib/plugin-support.exp
@@ -103,7 +103,7 @@ proc plugin-test-execute { plugin_src plugin_tests } {
}
set optstr [concat $optstr "-DIN_GCC -fPIC -shared -fno-rtti -undefined dynamic_lookup"]
} else {
- set plug_cflags $PLUGINCFLAGS
+ set plug_cflags "$PLUGINCFLAGS -std=c++11"
set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared -fno-rtti"
}
--
2.31.1

View File

@ -0,0 +1,36 @@
From 87e2a4f28b444f376ebe15f38e2743eb952ff355 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Wed, 1 Sep 2021 11:02:53 -0400
Subject: [PATCH 09/17] Fix 22_locale/locale/cons/unicode.cc when run under DTS
Various has_facet calls return false in DTS, as DTS is using the
std::locale from the system libstdc++.
Hence this patch tweaks tests to remove the VERIFY from the result of
the call, so that they do not fail if run against an older
std::locale.
These VERIFY tests were added upstream 2015-01-16 in
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=bb93f35da1612940266f5d159b6cc5a3e54fca14
---
libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc
index 15c621099..328145094 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc
@@ -70,8 +70,8 @@ void test01()
VERIFY( has_facet<w_codecvt>(loc13) );
#endif
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
- VERIFY( has_facet<u16_codecvt>(loc13) );
- VERIFY( has_facet<u32_codecvt>(loc13) );
+ (void)( has_facet<u16_codecvt>(loc13) );
+ (void)( has_facet<u32_codecvt>(loc13) );
#ifdef _GLIBCXX_USE_CHAR8_T
VERIFY( has_facet<u16u8_codecvt>(loc13) );
VERIFY( has_facet<u32u8_codecvt>(loc13) );
--
2.31.1

View File

@ -0,0 +1,30 @@
From d1555ffdd9b4fa6f3ceaa166bbfee0b3b9973ecf Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Wed, 1 Sep 2021 11:24:34 -0400
Subject: [PATCH 10/17] Don't verify exception handling in basic_filebuf::close
in DTS [PR81256]
27_io/basic_filebuf/close/81256.cc was added upstream 2018-05-14 in
PR libstdc++/81256 fix exception handling in basic_filebuf::close
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e77497ab777d3dfa19224648d658220807ab7419
When run under DTS,
std::basic_filebuf<wchar_t, std::char_traits<wchar_t> >::close
comes from the system libstdc++, and hence the test fails.
---
libstdc++-v3/testsuite/27_io/basic_filebuf/close/81256.cc | 1 -
1 file changed, 1 deletion(-)
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/wchar_t/81256.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/wchar_t/81256.cc
@@ -80,7 +80,6 @@ test01()
caught = true;
}
VERIFY( conv.exceptions_thrown == 1 );
- VERIFY( caught );
}
VERIFY( conv.exceptions_thrown == 1 );
}
--
2.31.1

View File

@ -0,0 +1,117 @@
From b6989e3a4acda2d75612f3f3847dbea4245ff536 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Wed, 1 Sep 2021 15:39:45 -0400
Subject: [PATCH 11/17] Add dts.exp and use it to fix
22_locale/messages/13631.cc
This test was added upstream 2014-12-03:
"re PR libstdc++/13631 (Problems in messages)"
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=d31008d7a0d53b431f176aad8dda5498de823122
as part of a fix that is present in the system libstdc++.so in
GCC 5 onwards.
When run in DTS against such a system library, this test will fail.
This patch introduces a dts.exp which detects the version of the
underlying system libstdc++.so and exposes it to tests via
-D__CXXSTDLIB_SO_VERSION__=, so that we can ifdef specific tests
away, conditionally on the base GCC.
---
.../testsuite/22_locale/messages/13631.cc | 7 +++++
libstdc++-v3/testsuite/lib/dts.exp | 31 +++++++++++++++++++
libstdc++-v3/testsuite/lib/libstdc++.exp | 6 ++++
3 files changed, 44 insertions(+)
create mode 100644 libstdc++-v3/testsuite/lib/dts.exp
diff --git a/libstdc++-v3/testsuite/22_locale/messages/13631.cc b/libstdc++-v3/testsuite/22_locale/messages/13631.cc
index b8ae3d4f1..5b20df382 100644
--- a/libstdc++-v3/testsuite/22_locale/messages/13631.cc
+++ b/libstdc++-v3/testsuite/22_locale/messages/13631.cc
@@ -50,7 +50,10 @@ void test01()
msgs_facet.close(fake_msgs);
msgs_facet.close(msgs);
+ // Fixed upstream in GCC 5
+#if __CXXSTDLIB_SO_VERSION__ >= 501000
VERIFY( translation1 == translation2 );
+#endif
}
void test02()
@@ -72,8 +75,12 @@ void test02()
std::wstring translation1 = msgs_facet.get(msgs, 0, 0, msgid);
// Without a real translation this test doesn't mean anything:
+
+ // Fixed upstream in GCC 5
+#if __CXXSTDLIB_SO_VERSION__ >= 501000
VERIFY( !translation1.empty() );
VERIFY( translation1 != msgid );
+#endif
// Opening another catalog was enough to show the problem, even a fake
// catalog.
diff --git a/libstdc++-v3/testsuite/lib/dts.exp b/libstdc++-v3/testsuite/lib/dts.exp
new file mode 100644
index 000000000..76ece66d3
--- /dev/null
+++ b/libstdc++-v3/testsuite/lib/dts.exp
@@ -0,0 +1,31 @@
+# For DTS testing, generate a number expressing the
+# system version of libstdc++.so
+#
+# Generate a version number equivalent to
+# #define GCC_VERSION (__GNUC__ * 10000 \
+# + __GNUC_MINOR__ * 100 \
+# + __GNUC_PATCHLEVEL__)
+#
+# For example, given an underlying version of gcc 4.8.5
+# this function will return 408050.
+
+proc get_dts_base_version { } {
+
+ # Invoke gcc in the PATH to get at the underlying GCC version
+ # in dotted form (e.g. "4.8.5").
+ set dotted_version [exec gcc -dumpversion]
+ verbose "dotted_version: '$dotted_version'" 2
+
+ # Extract major, minor, patchlevel
+ regexp {([0-9]+)\.([0-9]+)\.([0-9]+)} \
+ $dotted_version \
+ _ major minor patchlevel
+ verbose "major: '$major'" 2
+ verbose "minor: '$minor'" 2
+ verbose "patchlevel: '$patchlevel'" 2
+
+ set base_gcc_version [expr (($major * 10000) + ($minor * 100) + $patchlevel)]
+ verbose "base_gcc_version: '$base_gcc_version'" 2
+
+ return $base_gcc_version
+}
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 7f9580db8..5e4b32f76 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -58,6 +58,7 @@ load_gcc_lib timeout.exp
load_gcc_lib timeout-dg.exp
load_gcc_lib wrapper.exp
load_gcc_lib target-utils.exp
+load_lib dts.exp
# Useful for debugging. Pass the name of a variable and the verbosity
# threshold (number of -v's on the command line).
@@ -323,6 +324,11 @@ proc libstdc++_init { testfile } {
set ccflags "$cxxflags -DLOCALEDIR=\".\""
set cxxflags "$cxxflags -DLOCALEDIR=\".\""
+ # For DTS testing, expose the system version of libstdc++.so as
+ # a preprocessor define.
+ set base_gcc_version [get_dts_base_version]
+ set cxxflags "$cxxflags -D__CXXSTDLIB_SO_VERSION__=$base_gcc_version"
+
# If a PCH file is available, use it. We must delay performing
# this check until $cxx and such have been initialized because we
# perform a test compilation. (Ideally, gcc --print-file-name would
--
2.31.1

View File

@ -0,0 +1,28 @@
From c3910bb945aba02e0c06dec041da9f1f148b0df1 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 2 Sep 2021 11:40:42 -0400
Subject: [PATCH 12/17] dts.exp: use /usr/bin/gcc
---
libstdc++-v3/testsuite/lib/dts.exp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/testsuite/lib/dts.exp b/libstdc++-v3/testsuite/lib/dts.exp
index 76ece66d3..dc5cf3e95 100644
--- a/libstdc++-v3/testsuite/lib/dts.exp
+++ b/libstdc++-v3/testsuite/lib/dts.exp
@@ -11,9 +11,9 @@
proc get_dts_base_version { } {
- # Invoke gcc in the PATH to get at the underlying GCC version
+ # Invoke /usr/bin/gcc to get at the underlying GCC version
# in dotted form (e.g. "4.8.5").
- set dotted_version [exec gcc -dumpversion]
+ set dotted_version [exec /usr/bin/gcc -dumpversion]
verbose "dotted_version: '$dotted_version'" 2
# Extract major, minor, patchlevel
--
2.31.1

View File

@ -0,0 +1,86 @@
From c922a56d4461c9e4ca2af07ecccb3626b99a35ae Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 2 Sep 2021 11:44:37 -0400
Subject: [PATCH 13/17] Rename __CXXSTDLIB_SO_VERSION__ to
__LIBSTDCXX_SO_VERSION and only use major version
---
.../testsuite/22_locale/messages/13631.cc | 4 ++--
libstdc++-v3/testsuite/lib/dts.exp | 18 +++++-------------
libstdc++-v3/testsuite/lib/libstdc++.exp | 4 ++--
3 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/libstdc++-v3/testsuite/22_locale/messages/13631.cc b/libstdc++-v3/testsuite/22_locale/messages/13631.cc
index 5b20df382..f4c5eb7a2 100644
--- a/libstdc++-v3/testsuite/22_locale/messages/13631.cc
+++ b/libstdc++-v3/testsuite/22_locale/messages/13631.cc
@@ -51,7 +51,7 @@ void test01()
msgs_facet.close(msgs);
// Fixed upstream in GCC 5
-#if __CXXSTDLIB_SO_VERSION__ >= 501000
+#if __LIBSTDCXX_SO_VERSION >= 5
VERIFY( translation1 == translation2 );
#endif
}
@@ -77,7 +77,7 @@ void test02()
// Without a real translation this test doesn't mean anything:
// Fixed upstream in GCC 5
-#if __CXXSTDLIB_SO_VERSION__ >= 501000
+#if __LIBSTDCXX_SO_VERSION >= 5
VERIFY( !translation1.empty() );
VERIFY( translation1 != msgid );
#endif
diff --git a/libstdc++-v3/testsuite/lib/dts.exp b/libstdc++-v3/testsuite/lib/dts.exp
index dc5cf3e95..60f94bd6d 100644
--- a/libstdc++-v3/testsuite/lib/dts.exp
+++ b/libstdc++-v3/testsuite/lib/dts.exp
@@ -1,15 +1,10 @@
-# For DTS testing, generate a number expressing the
-# system version of libstdc++.so
-#
-# Generate a version number equivalent to
-# #define GCC_VERSION (__GNUC__ * 10000 \
-# + __GNUC_MINOR__ * 100 \
-# + __GNUC_PATCHLEVEL__)
+# For DTS testing, get the major version of the
+# system libstdc++.so
#
# For example, given an underlying version of gcc 4.8.5
-# this function will return 408050.
+# this function will return 4
-proc get_dts_base_version { } {
+proc get_dts_base_major_version { } {
# Invoke /usr/bin/gcc to get at the underlying GCC version
# in dotted form (e.g. "4.8.5").
@@ -24,8 +19,5 @@ proc get_dts_base_version { } {
verbose "minor: '$minor'" 2
verbose "patchlevel: '$patchlevel'" 2
- set base_gcc_version [expr (($major * 10000) + ($minor * 100) + $patchlevel)]
- verbose "base_gcc_version: '$base_gcc_version'" 2
-
- return $base_gcc_version
+ return $major
}
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 5e4b32f76..297485b19 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -326,8 +326,8 @@ proc libstdc++_init { testfile } {
# For DTS testing, expose the system version of libstdc++.so as
# a preprocessor define.
- set base_gcc_version [get_dts_base_version]
- set cxxflags "$cxxflags -D__CXXSTDLIB_SO_VERSION__=$base_gcc_version"
+ set base_gcc_version [get_dts_base_major_version]
+ set cxxflags "$cxxflags -D__LIBSTDCXX_SO_VERSION=$base_gcc_version"
# If a PCH file is available, use it. We must delay performing
# this check until $cxx and such have been initialized because we
--
2.31.1

View File

@ -0,0 +1,84 @@
From fa770c25013df537c41d0929c4202b0a774a6a75 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 2 Sep 2021 15:27:59 -0400
Subject: [PATCH 14/17] Conditionalize tests for PR libstdc++/98466 on
__LIBSTDCXX_SO_VERSION >= 11
The tests:
23_containers/deque/debug/98466.cc
23_containers/unordered_map/debug/98466.cc
were added upstream 2021-01-01 as part of:
libstdc++: Implement N3644 for _GLIBCXX_DEBUG iterators
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=05a30af3f237984b4dcf1dbbc17fdac583c46506
but fail when run in DTS against a system libstdc++.so
from an older GCC.
In particular, they use the older implementation of _M_can_compare from
the dynamic library:
$ eu-readelf -s 98466.exe | grep can_compare | c++filt
11: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF __gnu_debug::_Safe_iterator_base::_M_can_compare(__gnu_debug::_Safe_iterator_base const&) const@GLIBCXX_3.4 (4)
157: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF __gnu_debug::_Safe_iterator_base::_M_can_compare(__gnu_debug::_Safe_iterator_base const&) const@@GLIBCXX_3.4
---
.../testsuite/23_containers/deque/debug/98466.cc | 6 ++++++
.../23_containers/unordered_map/debug/98466.cc | 12 ++++++++++++
2 files changed, 18 insertions(+)
diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc
index c2d793374..e92d719bf 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc
@@ -26,11 +26,17 @@ void test01()
{
typedef typename __gnu_debug::deque<int>::iterator It;
It it = It();
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( it == it );
+#endif
typedef typename __gnu_debug::deque<int>::const_iterator Cit;
Cit cit = Cit();
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( cit == cit );
+#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/98466.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/98466.cc
index cc22b9ff8..3a1b6cd32 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/98466.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/98466.cc
@@ -25,16 +25,28 @@
void test01()
{
__gnu_debug::unordered_map<int, int>::iterator it{};
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( it == it );
+#endif
__gnu_debug::unordered_map<int, int>::const_iterator cit{};
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( cit == cit );
+#endif
__gnu_debug::unordered_map<int, int>::local_iterator lit{};
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( lit == lit );
+#endif
__gnu_debug::unordered_map<int, int>::const_local_iterator clit{};
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( clit == clit );
+#endif
}
int main()
--
2.31.1

View File

@ -0,0 +1,41 @@
From 992665eab6c48d6a4819f42509346d24b277485d Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 2 Sep 2021 16:17:29 -0400
Subject: [PATCH 15/17] Conditionalize test for PR libstdc++/87135 on
__LIBSTDCXX_SO_VERSION >= 9
This VERIFY was added upstream 2018-09-18 as part of:
re PR libstdc++/87135 ([C++17] unordered containers violate iterator validity requirements)
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=a521e62615e439aea7502a52fd0f8a21eaa6304f
but fails when run in DTS against a system libstdc++.so from an older GCC.
In particular, rehash from the header is using
std::__detail::_Prime_rehash_policy::_M_next_bkt
from the system .so:
12: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const@GLIBCXX_3.4.18 (5)
225: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const@@GLIBCXX_3.4.18
---
.../23_containers/unordered_map/modifiers/reserve.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc
index 58c8924b9..4c79ec2e6 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc
@@ -46,7 +46,11 @@ void test01()
// As long as we insert less than the reserved number of elements we
// shouldn't experiment any rehash.
+
+ // Fixed upstream in GCC 9
+#if __LIBSTDCXX_SO_VERSION >= 9
VERIFY( m.bucket_count() == bkts );
+#endif
VERIFY( m.load_factor() <= m.max_load_factor() );
}
--
2.31.1

View File

@ -0,0 +1,102 @@
From db8f53df0be1daeda3159c1413549ff40696c710 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 2 Sep 2021 17:02:33 -0400
Subject: [PATCH 16/17] Conditionalize test for hashtable bucket sizes on
__LIBSTDCXX_SO_VERSION >= 11
These tests were added upstream 2020-01-20 as part of:
libstdc++: Do not over-size hashtable buckets on range insertion
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=6dcf042368012e2d7ce1626ee5d378bf3ad0ccfc
but fail when run in DTS against a system libstdc++.so from an older GCC.
In particular, _M_insert_unique_node from the header is using the older
implementation of
std::__detail::_Prime_rehash_policy::_M_need_rehash
from the dynamic library.
23: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const@GLIBCXX_3.4.18 (5)
412: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const@@GLIBCXX_3.4.18
---
.../23_containers/unordered_set/cons/bucket_hint.cc | 10 ++++++++++
.../23_containers/unordered_set/modifiers/insert.cc | 9 +++++++++
2 files changed, 19 insertions(+)
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/cons/bucket_hint.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/bucket_hint.cc
index a3b014a3a..af231e54e 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/cons/bucket_hint.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/bucket_hint.cc
@@ -29,7 +29,11 @@ void test01()
a.reserve(2);
std::unordered_set<int> b({ 0, 1, 0, 1, 0, 1, 0, 1 }, a.bucket_count());
+
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( b.bucket_count() == a.bucket_count() );
+#endif
}
void test02()
@@ -40,7 +44,10 @@ void test02()
std::vector<int> v { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 };
std::unordered_set<int> b(v.begin(), v.end(), a.bucket_count());
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( b.bucket_count() == a.bucket_count() );
+#endif
}
void test03()
@@ -51,7 +58,10 @@ void test03()
std::forward_list<int> fl { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 };
std::unordered_set<int> b(fl.begin(), fl.end(), a.bucket_count());
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( b.bucket_count() == a.bucket_count() );
+#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/insert.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/insert.cc
index 015c2f872..aae8298ae 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/insert.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/insert.cc
@@ -30,7 +30,10 @@ void test01()
auto bkt_count = a.bucket_count();
a.insert({ 0, 1, 0, 1, 0, 1, 0, 1 });
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( a.bucket_count() == bkt_count );
+#endif
}
void test02()
@@ -42,7 +45,10 @@ void test02()
auto bkt_count = a.bucket_count();
a.insert(v.begin(), v.end());
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( a.bucket_count() == bkt_count );
+#endif
}
void test03()
@@ -54,7 +60,10 @@ void test03()
auto bkt_count = a.bucket_count();
a.insert(fl.begin(), fl.end());
+ // Fixed upstream in GCC 11
+#if __LIBSTDCXX_SO_VERSION >= 11
VERIFY( a.bucket_count() == bkt_count );
+#endif
}
int main()
--
2.31.1

View File

@ -0,0 +1,33 @@
From 102adc148612b50a4e3f12a88871ddc47bfb469e Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 2 Sep 2021 17:17:50 -0400
Subject: [PATCH 17/17] Conditionalize test for PR libstdc++/71181 on
__LIBSTDCXX_SO_VERSION >= 7
This test was added upstream 2016-06-20 as part of:
re PR libstdc++/71181 (Reserving in unordered_map doesn't reserve enough)
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=29dbb034cb3199167a9d0aaed040733c72326eed
but fails when run in DTS against a system libstdc++.so from an older GCC.
---
.../testsuite/23_containers/unordered_set/hash_policy/71181.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/hash_policy/71181.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/hash_policy/71181.cc
index 324d735b8..b2dcd0137 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/hash_policy/71181.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/hash_policy/71181.cc
@@ -39,7 +39,10 @@ template<typename _USet>
us.insert(nb_insert);
+ // Fixed upstream in GCC 7
+#if __LIBSTDCXX_SO_VERSION >= 7
VERIFY( us.bucket_count() == bkts );
+#endif
}
}
--
2.31.1

View File

@ -0,0 +1,13 @@
diff --git a/gcc/testsuite/g++.dg/warn/Wfree-nonheap-object-3.C b/gcc/testsuite/g++.dg/warn/Wfree-nonheap-object-3.C
index 47f97dcb636..66f07aaa749 100644
--- a/gcc/testsuite/g++.dg/warn/Wfree-nonheap-object-3.C
+++ b/gcc/testsuite/g++.dg/warn/Wfree-nonheap-object-3.C
@@ -4,6 +4,8 @@
{ dg-do compile { target c++11 } }
{ dg-options "-O2 -Wall" } */
+#define _GLIBCXX_USE_CXX11_ABI 1
+
#include <memory>
#include <string>

View File

@ -0,0 +1,16 @@
Looks like a known fail:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101674
diff --git a/gcc/testsuite/gcc.dg/uninit-pred-9_b.c b/gcc/testsuite/gcc.dg/uninit-pred-9_b.c
index 53c4a5399ea..c2b043f5019 100644
--- a/gcc/testsuite/gcc.dg/uninit-pred-9_b.c
+++ b/gcc/testsuite/gcc.dg/uninit-pred-9_b.c
@@ -17,7 +17,7 @@ int foo (int n, int l, int m, int r)
if (l > 100)
if ( (n <= 9) && (m < 100) && (r < 19) )
- blah(v); /* { dg-bogus "uninitialized" "bogus warning" { xfail powerpc64*-*-* cris-*-* riscv*-*-* } } */
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" { xfail powerpc64*-*-* cris-*-* riscv*-*-* s390*-*-* } } */
if ( (n <= 8) && (m < 99) && (r < 19) )
blah(v); /* { dg-bogus "uninitialized" "pr101674" { xfail mmix-*-* } } */

View File

@ -0,0 +1,12 @@
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c
index b64e71dae22..5bf47b20820 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c
@@ -12,7 +12,6 @@
jump threading opportunities. Skip the later tests on aarch64. */
/* { dg-final { scan-tree-dump-not "Jumps threaded" "dom3" { target { ! aarch64*-*-* } } } } */
/* { dg-final { scan-tree-dump "Jumps threaded: 9" "thread2" { target { ! aarch64*-*-* } } } } */
-/* { dg-final { scan-tree-dump "Jumps threaded: 18" "thread2" { target { aarch64*-*-* } } } } */
enum STATE {
S0=0,

View File

@ -0,0 +1,424 @@
See https://bugzilla.redhat.com/show_bug.cgi?id=2095749#c3
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/char/2.cc
index 071597b4dd3..22cfdc7415b 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/char/2.cc
@@ -99,5 +99,7 @@ void test02()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test02();
+#endif
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
index ec0f943dd73..6c7c0c60ed0 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
@@ -351,6 +351,8 @@ test01()
int
main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/char/4.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/char/4.cc
index d0619f9de1f..499871bf5b4 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/char/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/char/4.cc
@@ -238,6 +238,8 @@ test01()
int
main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/char/71367.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/char/71367.cc
index 9171b7d5a17..9c6d1794991 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/char/71367.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/char/71367.cc
@@ -62,6 +62,8 @@ test01()
int
main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/char/71557.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/char/71557.cc
index 9d004b05e87..9eeff07aaf3 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/char/71557.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/char/71557.cc
@@ -91,6 +91,8 @@ test01()
int
main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc
index 45d4edeca00..6e2efad56d4 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc
@@ -351,6 +351,8 @@ test01()
int
main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/4.cc
index 0518842692f..485c1b41d1b 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/4.cc
@@ -238,6 +238,8 @@ test01()
int
main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/71367.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/71367.cc
index 456472601be..180255e948e 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/71367.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/71367.cc
@@ -62,6 +62,8 @@ test01()
int
main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/71557.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/71557.cc
index 7c5a829fa60..38673aac17b 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/71557.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/71557.cc
@@ -91,6 +91,8 @@ test01()
int
main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/6.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/6.cc
index e50afa6aa73..2f326f85afe 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/6.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/6.cc
@@ -74,6 +74,8 @@ void test01()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/6.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/6.cc
index f6e32b7f781..54a921e243b 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/6.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/6.cc
@@ -74,6 +74,8 @@ void test01()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/ws/char/lwg415.cc b/libstdc++-v3/testsuite/27_io/basic_istream/ws/char/lwg415.cc
index fe6980dff29..0a033b81138 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/ws/char/lwg415.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/ws/char/lwg415.cc
@@ -71,7 +71,9 @@ test03()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
test02();
test03();
+#endif
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/ws/wchar_t/lwg415.cc b/libstdc++-v3/testsuite/27_io/basic_istream/ws/wchar_t/lwg415.cc
index fd040098b40..3adabc60221 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/ws/wchar_t/lwg415.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/ws/wchar_t/lwg415.cc
@@ -71,7 +71,9 @@ test03()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
test02();
test03();
+#endif
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/noreplace.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/noreplace.cc
index e39f5928a1f..22421b158cb 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/noreplace.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/noreplace.cc
@@ -15,6 +15,7 @@
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
#if __cpp_lib_ios_noreplace
std::ios::openmode noreplace = std::ios::noreplace;
#else
@@ -26,4 +27,5 @@ int main()
of.close();
of.open("noreplace", noreplace);
VERIFY( ! of.is_open() );
+#endif
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/wchar_t/noreplace.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/wchar_t/noreplace.cc
index 77f11865ac4..07748578417 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/wchar_t/noreplace.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/wchar_t/noreplace.cc
@@ -15,6 +15,7 @@
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
#if __cpp_lib_ios_noreplace
std::wios::openmode noreplace = std::wios::noreplace;
#else
@@ -26,4 +27,5 @@ int main()
of.close();
of.open("noreplace", noreplace);
VERIFY( ! of.is_open() );
+#endif
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/n3168.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/n3168.cc
index 12da0b1f011..689ee0ee85b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/n3168.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/n3168.cc
@@ -98,6 +98,8 @@ test02()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
test02();
+#endif
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/n3168.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/n3168.cc
index 652f46f615c..abe55ca1285 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/n3168.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/n3168.cc
@@ -96,6 +96,8 @@ test02()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
test02();
+#endif
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/n3168.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/n3168.cc
index 8c2fe85db36..92fb45495c1 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/n3168.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/n3168.cc
@@ -59,6 +59,8 @@ test02()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
test02();
+#endif
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/n3168.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/n3168.cc
index 887a9a773d1..efb0c2e878a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/n3168.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/n3168.cc
@@ -59,6 +59,8 @@ test02()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
test02();
+#endif
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc
index 39ff1761c55..9583c630fa8 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc
@@ -91,6 +91,8 @@ static bool ampm_time_format()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test02();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc
index 228d61f1e41..a1c3265155f 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc
@@ -91,6 +91,8 @@ static bool ampm_time_format()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test02();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/2.cc
index adbf7e7e733..4d6b4e2ec96 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/2.cc
@@ -99,5 +99,7 @@ void test02()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test02();
+#endif
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/2.cc
index de7a371c1c4..d5fc73d1a36 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/2.cc
@@ -59,7 +59,9 @@ void test02()
VERIFY( os.good() );
VERIFY( buf.sync_called() );
+#if __LIBSTDCXX_SO_VERSION >= 8
VERIFY( buf_tie.sync_called() );
+#endif
}
void
@@ -80,7 +82,9 @@ test03()
VERIFY( os.rdstate() & std::ios_base::eofbit );
VERIFY( !buf.sync_called() );
+#if __LIBSTDCXX_SO_VERSION >= 8
VERIFY( !buf_tie.sync_called() );
+#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/flush/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/flush/wchar_t/2.cc
index b330be46afa..40b9dfdb61b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/flush/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/flush/wchar_t/2.cc
@@ -57,7 +57,9 @@ void test02()
VERIFY( os.good() );
VERIFY( buf.sync_called() );
+#if __LIBSTDCXX_SO_VERSION >= 8
VERIFY( buf_tie.sync_called() );
+#endif
}
void
@@ -78,7 +80,9 @@ test03()
VERIFY( os.rdstate() & std::ios_base::eofbit );
VERIFY( !buf.sync_called() );
+#if __LIBSTDCXX_SO_VERSION >= 8
VERIFY( !buf_tie.sync_called() );
+#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc
index 138648f5264..70f651818ba 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc
@@ -73,7 +73,9 @@ void test02()
// libstdc++/9546
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
test02();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/exceptions_badbit_throw.cc
index 731df74de9f..b6d31711910 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/exceptions_badbit_throw.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/exceptions_badbit_throw.cc
@@ -73,7 +73,9 @@ void test02()
// libstdc++/9546
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
test02();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc
index 2eccfdceb94..98d57ff4259 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc
@@ -47,6 +47,8 @@ void test01()
// libstdc++/9546
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/exceptions_badbit_throw.cc
index 92161b22632..9d75c2c69fb 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/exceptions_badbit_throw.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/exceptions_badbit_throw.cc
@@ -47,6 +47,8 @@ void test01()
// libstdc++/9546
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc b/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc
index d4cd0dc3040..a60acf00b04 100644
--- a/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc
@@ -44,5 +44,7 @@ void test01()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
}
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/wchar_t/2.cc
index c639ce54906..5c749922016 100644
--- a/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/wchar_t/2.cc
@@ -45,5 +45,7 @@ void test01()
int main()
{
+#if __LIBSTDCXX_SO_VERSION >= 8
test01();
+#endif
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,62 @@
2022-01-07 Jakub Jelinek <jakub@redhat.com>
* Makefile.tpl (GOCFLAGS, GDCFLAGS): Filter out -Wformat-security.
* Makefile.in: Regenerated.
2017-02-25 Jakub Jelinek <jakub@redhat.com>
* configure.ac: When adding -Wno-format, also add -Wno-format-security.
* configure: Regenerated.
--- gcc/configure.ac.jj 2017-02-13 12:20:53.000000000 +0100
+++ gcc/configure.ac 2017-02-25 12:42:32.859175403 +0100
@@ -570,7 +570,7 @@ AC_ARG_ENABLE(build-format-warnings,
AS_HELP_STRING([--disable-build-format-warnings],[don't use -Wformat while building GCC]),
[],[enable_build_format_warnings=yes])
AS_IF([test $enable_build_format_warnings = no],
- [wf_opt=-Wno-format],[wf_opt=])
+ [wf_opt="-Wno-format -Wno-format-security"],[wf_opt=])
ACX_PROG_CXX_WARNING_OPTS(
m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings ],
[-Wcast-qual $wf_opt])),
--- gcc/configure.jj 2017-02-13 12:20:52.000000000 +0100
+++ gcc/configure 2017-02-25 12:42:50.041946391 +0100
@@ -7077,7 +7077,7 @@ else
fi
if test $enable_build_format_warnings = no; then :
- wf_opt=-Wno-format
+ wf_opt="-Wno-format -Wno-format-security"
else
wf_opt=
fi
--- Makefile.tpl.jj 2023-11-29 13:21:41.680292662 +0100
+++ Makefile.tpl 2023-11-29 13:23:24.677839321 +0100
@@ -448,9 +448,9 @@ LDFLAGS = @LDFLAGS@
LIBCFLAGS = $(CFLAGS)
CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
-GOCFLAGS = $(CFLAGS)
-GDCFLAGS = @GDCFLAGS@
-GM2FLAGS = $(CFLAGS)
+GOCFLAGS = $(filter-out -Wformat-security,$(CFLAGS))
+GDCFLAGS = $(filter-out -Wformat-security,@GDCFLAGS@)
+GM2FLAGS = $(filter-out -Wformat-security,$(CFLAGS))
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
--- Makefile.in.jj 2023-11-29 13:21:41.691292507 +0100
+++ Makefile.in 2023-11-29 13:24:01.254323180 +0100
@@ -445,9 +445,9 @@ LDFLAGS = @LDFLAGS@
LIBCFLAGS = $(CFLAGS)
CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
-GOCFLAGS = $(CFLAGS)
-GDCFLAGS = @GDCFLAGS@
-GM2FLAGS = $(CFLAGS)
+GOCFLAGS = $(filter-out -Wformat-security,$(CFLAGS))
+GDCFLAGS = $(filter-out -Wformat-security,@GDCFLAGS@)
+GM2FLAGS = $(filter-out -Wformat-security,$(CFLAGS))
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@

View File

@ -0,0 +1,20 @@
2019-01-17 Jakub Jelinek <jakub@redhat.com>
* d-spec.cc (lang_specific_driver): Make -shared-libphobos
the default rather than -static-libphobos.
--- gcc/d/d-spec.cc.jj 2019-01-01 12:37:49.502444257 +0100
+++ gcc/d/d-spec.cc 2019-01-17 17:09:45.364949246 +0100
@@ -408,9 +408,9 @@ lang_specific_driver (cl_decoded_option
/* Add `-lgphobos' if we haven't already done so. */
if (phobos_library != PHOBOS_NOLINK)
{
- /* Default to static linking. */
- if (phobos_library != PHOBOS_DYNAMIC)
- phobos_library = PHOBOS_STATIC;
+ /* Default to shared linking. */
+ if (phobos_library != PHOBOS_STATIC)
+ phobos_library = PHOBOS_DYNAMIC;
#ifdef HAVE_LD_STATIC_DYNAMIC
if (phobos_library == PHOBOS_STATIC && !static_link)

View File

@ -0,0 +1,44 @@
--- a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-pr100400-1-3.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-pr100400-1-3.c
@@ -1,6 +1,6 @@
/* { dg-additional-options "--param openacc-kernels=decompose" } */
-/* { dg-additional-options "-fchecking" }
+/* { dg-additional-options "-fchecking -fno-report-bug" }
{ dg-ice TODO { c++ } }
{ dg-prune-output "during GIMPLE pass: omp_oacc_kernels_decompose" } */
--- a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-pr100400-1-4.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-pr100400-1-4.c
@@ -1,6 +1,6 @@
/* { dg-additional-options "--param openacc-kernels=decompose" } */
-/* { dg-additional-options "-fchecking" }
+/* { dg-additional-options "-fchecking -fno-report-bug" }
{ dg-ice TODO { c++ } }
{ dg-prune-output "during GIMPLE pass: omp_oacc_kernels_decompose" } */
diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-88982.C b/gcc/testsuite/g++.dg/cpp0x/vt-88982.C
index 7a868233d73..45307a63483 100644
--- a/gcc/testsuite/g++.dg/cpp0x/vt-88982.C
+++ b/gcc/testsuite/g++.dg/cpp0x/vt-88982.C
@@ -1,6 +1,6 @@
// PR c++/88982
// { dg-do compile { target c++11 } }
-// { dg-additional-options "-fchecking" }
+// { dg-additional-options "-fchecking -fno-report-bug" }
// { dg-ice "tsubst_pack_expansion" }
template<typename...Ts> struct A {
diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn61.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn61.C
index bed5ea0cfc0..cb235bf891a 100644
--- a/gcc/testsuite/g++.dg/cpp1y/auto-fn61.C
+++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn61.C
@@ -1,6 +1,6 @@
// PR c++/88003
// { dg-do compile { target c++14 } }
-// { dg-additional-options "-fchecking" }
+// { dg-additional-options "-fchecking -fno-report-bug" }
// { dg-ice "poplevel_class" }
auto test() {

View File

@ -0,0 +1,215 @@
From 23b1fcb104c666429451ffaf936f8da5fcd3d43a Mon Sep 17 00:00:00 2001
From: Mark Eggleston <markeggleston@gcc.gnu.org>
Date: Fri, 22 Jan 2021 12:29:47 +0000
Subject: [PATCH 01/10] Allow duplicate declarations.
Enabled by -fdec-duplicates and -fdec.
Some fixes by Jim MacArthur <jim.macarthur@codethink.co.uk>
Addition of -fdec-duplicates by Mark Eggleston <mark.eggleston@codethink.com>
---
gcc/fortran/lang.opt | 4 ++++
gcc/fortran/options.cc | 1 +
gcc/fortran/symbol.cc | 21 +++++++++++++++++--
.../gfortran.dg/duplicate_type_4.f90 | 13 ++++++++++++
.../gfortran.dg/duplicate_type_5.f90 | 13 ++++++++++++
.../gfortran.dg/duplicate_type_6.f90 | 13 ++++++++++++
.../gfortran.dg/duplicate_type_7.f90 | 13 ++++++++++++
.../gfortran.dg/duplicate_type_8.f90 | 12 +++++++++++
.../gfortran.dg/duplicate_type_9.f90 | 12 +++++++++++
9 files changed, 100 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/gfortran.dg/duplicate_type_4.f90
create mode 100644 gcc/testsuite/gfortran.dg/duplicate_type_5.f90
create mode 100644 gcc/testsuite/gfortran.dg/duplicate_type_6.f90
create mode 100644 gcc/testsuite/gfortran.dg/duplicate_type_7.f90
create mode 100644 gcc/testsuite/gfortran.dg/duplicate_type_8.f90
create mode 100644 gcc/testsuite/gfortran.dg/duplicate_type_9.f90
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 2b1977c523b..52bd522051e 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -469,6 +469,10 @@ Fortran Var(flag_dec_char_conversions)
Enable the use of character literals in assignments and data statements
for non-character variables.
+fdec-duplicates
+Fortran Var(flag_dec_duplicates)
+Allow varibles to be duplicated in the type specification matches.
+
fdec-include
Fortran Var(flag_dec_include)
Enable legacy parsing of INCLUDE as statement.
diff --git a/gcc/fortran/options.cc b/gcc/fortran/options.cc
index 3a0b98bf1ec..f19ba87f8a0 100644
--- a/gcc/fortran/options.cc
+++ b/gcc/fortran/options.cc
@@ -77,6 +77,7 @@ set_dec_flags (int value)
SET_BITFLAG (flag_dec_format_defaults, value, value);
SET_BITFLAG (flag_dec_blank_format_item, value, value);
SET_BITFLAG (flag_dec_char_conversions, value, value);
+ SET_BITFLAG (flag_dec_duplicates, value, value);
}
/* Finalize DEC flags. */
diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc
index 3b988d1be22..9843175cc2a 100644
--- a/gcc/fortran/symbol.cc
+++ b/gcc/fortran/symbol.cc
@@ -1995,6 +1995,8 @@ gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where)
if (sym->attr.result && type == BT_UNKNOWN && sym->ns->proc_name)
type = sym->ns->proc_name->ts.type;
+ flavor = sym->attr.flavor;
+
if (type != BT_UNKNOWN && !(sym->attr.function && sym->attr.implicit_type)
&& !(gfc_state_stack->previous && gfc_state_stack->previous->previous
&& gfc_state_stack->previous->previous->state == COMP_SUBMODULE)
@@ -2007,6 +2009,23 @@ gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where)
else if (sym->attr.function && sym->attr.result)
gfc_error ("Symbol %qs at %L already has basic type of %s",
sym->ns->proc_name->name, where, gfc_basic_typename (type));
+ else if (flag_dec_duplicates)
+ {
+ /* Ignore temporaries and class/procedure names */
+ if (sym->ts.type == BT_DERIVED || sym->ts.type == BT_CLASS
+ || sym->ts.type == BT_PROCEDURE)
+ return false;
+
+ if (gfc_compare_types (&sym->ts, ts)
+ && (flavor == FL_UNKNOWN || flavor == FL_VARIABLE
+ || flavor == FL_PROCEDURE))
+ {
+ return gfc_notify_std (GFC_STD_LEGACY,
+ "Symbol '%qs' at %L already has "
+ "basic type of %s", sym->name, where,
+ gfc_basic_typename (type));
+ }
+ }
else
gfc_error ("Symbol %qs at %L already has basic type of %s", sym->name,
where, gfc_basic_typename (type));
@@ -2020,8 +2039,6 @@ gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where)
return false;
}
- flavor = sym->attr.flavor;
-
if (flavor == FL_PROGRAM || flavor == FL_BLOCK_DATA || flavor == FL_MODULE
|| flavor == FL_LABEL
|| (flavor == FL_PROCEDURE && sym->attr.subroutine)
diff --git a/gcc/testsuite/gfortran.dg/duplicate_type_4.f90 b/gcc/testsuite/gfortran.dg/duplicate_type_4.f90
new file mode 100644
index 00000000000..cdd29ea8846
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/duplicate_type_4.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+
+! PR fortran/30239
+! Check for errors when a symbol gets declared a type twice, even if it
+! is the same.
+
+INTEGER FUNCTION foo ()
+ IMPLICIT NONE
+ INTEGER :: x
+ INTEGER :: x ! { dg-error "basic type of" }
+ x = 42
+END FUNCTION foo
diff --git a/gcc/testsuite/gfortran.dg/duplicate_type_5.f90 b/gcc/testsuite/gfortran.dg/duplicate_type_5.f90
new file mode 100644
index 00000000000..00f931809aa
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/duplicate_type_5.f90
@@ -0,0 +1,13 @@
+! { dg-do run }
+! { dg-options "-fdec" }
+!
+! Test case contributed by Mark Eggleston <mark.eggleston@codethink.com>
+!
+
+program test
+ implicit none
+ integer :: x
+ integer :: x
+ x = 42
+ if (x /= 42) stop 1
+end program test
diff --git a/gcc/testsuite/gfortran.dg/duplicate_type_6.f90 b/gcc/testsuite/gfortran.dg/duplicate_type_6.f90
new file mode 100644
index 00000000000..f0df27e323c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/duplicate_type_6.f90
@@ -0,0 +1,13 @@
+! { dg-do run }
+! { dg-options "-std=legacy -fdec-duplicates" }
+!
+! Test case contributed by Mark Eggleston <mark.eggleston@codethink.com>
+!
+
+program test
+ implicit none
+ integer :: x
+ integer :: x
+ x = 42
+ if (x /= 42) stop 1
+end program test
diff --git a/gcc/testsuite/gfortran.dg/duplicate_type_7.f90 b/gcc/testsuite/gfortran.dg/duplicate_type_7.f90
new file mode 100644
index 00000000000..f32472ff586
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/duplicate_type_7.f90
@@ -0,0 +1,13 @@
+! { dg-do run }
+! { dg-options "-fdec-duplicates" }
+!
+! Test case contributed by Mark Eggleston <mark.eggleston@codethink.com>
+!
+
+program test
+ implicit none
+ integer :: x
+ integer :: x! { dg-warning "Legacy Extension" }
+ x = 42
+ if (x /= 42) stop 1
+end program test
diff --git a/gcc/testsuite/gfortran.dg/duplicate_type_8.f90 b/gcc/testsuite/gfortran.dg/duplicate_type_8.f90
new file mode 100644
index 00000000000..23c94add179
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/duplicate_type_8.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-options "-fdec -fno-dec-duplicates" }
+!
+! Test case contributed by Mark Eggleston <mark.eggleston@codethink.com>
+!
+
+integer function foo ()
+ implicit none
+ integer :: x
+ integer :: x ! { dg-error "basic type of" }
+ x = 42
+end function foo
diff --git a/gcc/testsuite/gfortran.dg/duplicate_type_9.f90 b/gcc/testsuite/gfortran.dg/duplicate_type_9.f90
new file mode 100644
index 00000000000..d5edee4d8ee
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/duplicate_type_9.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-options "-fdec-duplicates -fno-dec-duplicates" }
+!
+! Test case contributed by Mark Eggleston <mark.eggleston@codethink.com>
+!
+
+integer function foo ()
+ implicit none
+ integer :: x
+ integer :: x ! { dg-error "basic type of" }
+ x = 42
+end function foo
--
2.27.0

View File

@ -0,0 +1,126 @@
--- libada/Makefile.in.jj 2019-01-09 13:01:18.015608205 +0100
+++ libada/Makefile.in 2019-01-11 18:16:23.441726931 +0100
@@ -71,18 +71,40 @@ version := $(shell @get_gcc_base_ver@ $(
libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)
ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
+DEFAULTMULTIFLAGS :=
+ifeq ($(MULTISUBDIR),)
+targ:=$(subst -, ,$(target))
+arch:=$(word 1,$(targ))
+ifeq ($(words $(targ)),2)
+osys:=$(word 2,$(targ))
+else
+osys:=$(word 3,$(targ))
+endif
+ifeq ($(strip $(filter-out i%86 x86_64 powerpc% ppc% s390% sparc% linux%, $(arch) $(osys))),)
+ifeq ($(shell $(CC) $(CFLAGS) -print-multi-os-directory),../lib64)
+DEFAULTMULTIFLAGS := -m64
+else
+ifeq ($(strip $(filter-out s390%, $(arch))),)
+DEFAULTMULTIFLAGS := -m31
+else
+DEFAULTMULTIFLAGS := -m32
+endif
+endif
+endif
+endif
+
# exeext should not be used because it's the *host* exeext. We're building
# a *target* library, aren't we?!? Likewise for CC. Still, provide bogus
# definitions just in case something slips through the safety net provided
# by recursive make invocations in gcc/ada/Makefile.in
LIBADA_FLAGS_TO_PASS = \
"MAKEOVERRIDES=" \
- "LDFLAGS=$(LDFLAGS)" \
+ "LDFLAGS=$(LDFLAGS) $(DEFAULTMULTIFLAGS)" \
"LN_S=$(LN_S)" \
"SHELL=$(SHELL)" \
- "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \
- "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
- "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \
+ "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \
+ "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \
+ "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \
"PICFLAG_FOR_TARGET=$(PICFLAG)" \
"THREAD_KIND=$(THREAD_KIND)" \
"TRACE=$(TRACE)" \
@@ -93,7 +115,7 @@ LIBADA_FLAGS_TO_PASS = \
"exeext=.exeext.should.not.be.used " \
'CC=the.host.compiler.should.not.be.needed' \
"GCC_FOR_TARGET=$(CC)" \
- "CFLAGS=$(CFLAGS)"
+ "CFLAGS=$(CFLAGS) $(DEFAULTMULTIFLAGS)"
.PHONY: libada gnatlib gnatlib-shared gnatlib-sjlj gnatlib-zcx osconstool
--- config-ml.in.jj 2019-01-09 12:50:16.646501448 +0100
+++ config-ml.in 2019-01-11 18:16:23.442726914 +0100
@@ -511,6 +511,8 @@ multi-do:
ADAFLAGS="$(ADAFLAGS) $${flags}" \
prefix="$(prefix)" \
exec_prefix="$(exec_prefix)" \
+ mandir="$(mandir)" \
+ infodir="$(infodir)" \
GOCFLAGS="$(GOCFLAGS) $${flags}" \
GDCFLAGS="$(GDCFLAGS) $${flags}" \
CXXFLAGS="$(CXXFLAGS) $${flags}" \
--- libcpp/macro.cc.jj 2019-01-09 13:01:21.420552123 +0100
+++ libcpp/macro.cc 2019-01-11 18:18:17.736876285 +0100
@@ -3256,8 +3256,6 @@ static cpp_macro *
create_iso_definition (cpp_reader *pfile)
{
bool following_paste_op = false;
- const char *paste_op_error_msg =
- N_("'##' cannot appear at either end of a macro expansion");
unsigned int num_extra_tokens = 0;
unsigned nparms = 0;
cpp_hashnode **params = NULL;
@@ -3382,7 +3380,9 @@ create_iso_definition (cpp_reader *pfile
function-like macros, but not at the end. */
if (following_paste_op)
{
- cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
+ cpp_error (pfile, CPP_DL_ERROR,
+ "'##' cannot appear at either end of a macro "
+ "expansion");
goto out;
}
if (!vaopt_tracker.completed ())
@@ -3397,7 +3397,9 @@ create_iso_definition (cpp_reader *pfile
function-like macros, but not at the beginning. */
if (macro->count == 1)
{
- cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
+ cpp_error (pfile, CPP_DL_ERROR,
+ "'##' cannot appear at either end of a macro "
+ "expansion");
goto out;
}
--- libcpp/expr.cc.jj 2019-01-09 13:01:22.415535734 +0100
+++ libcpp/expr.cc 2019-01-11 18:16:23.444726882 +0100
@@ -803,16 +803,17 @@ cpp_classify_number (cpp_reader *pfile,
if ((result & CPP_N_WIDTH) == CPP_N_LARGE
&& CPP_OPTION (pfile, cpp_warn_long_long))
{
- const char *message = CPP_OPTION (pfile, cplusplus)
- ? N_("use of C++11 long long integer constant")
- : N_("use of C99 long long integer constant");
-
if (CPP_OPTION (pfile, c99))
cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location,
- 0, message);
+ 0, CPP_OPTION (pfile, cplusplus)
+ ? N_("use of C++11 long long integer constant")
+ : N_("use of C99 long long integer constant"));
else
cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG,
- virtual_location, 0, message);
+ virtual_location, 0,
+ CPP_OPTION (pfile, cplusplus)
+ ? N_("use of C++11 long long integer constant")
+ : N_("use of C99 long long integer constant"));
}
if ((result & CPP_N_SIZE_T) == CPP_N_SIZE_T

View File

@ -0,0 +1,716 @@
--- gcc/Makefile.in.jj 2015-06-06 10:00:25.000000000 +0200
+++ gcc/Makefile.in 2015-11-04 14:56:02.643536437 +0100
@@ -1063,7 +1063,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
# and the system's installed libraries.
LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \
$(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS)
-BACKENDLIBS = $(ISLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
+BACKENDLIBS = $(if $(ISLLIBS),-ldl) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
$(ZLIB) $(ZSTD_LIB)
# Any system libraries needed just for GNAT.
SYSLIBS = @GNAT_LIBEXC@
@@ -2302,6 +2302,15 @@ $(out_object_file): $(out_file)
$(common_out_object_file): $(common_out_file)
$(COMPILE) $<
$(POSTCOMPILE)
+
+graphite%.o : \
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
+graphite.o : \
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
+graphite%.o : \
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS))
+graphite.o : \
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS))
#
# Generate header and source files from the machine description,
# and compile them.
--- gcc/graphite.h.jj 2016-01-27 12:44:06.000000000 +0100
+++ gcc/graphite.h 2022-11-03 19:14:50.369690720 +0100
@@ -24,6 +24,591 @@ along with GCC; see the file COPYING3.
#include "sese.h"
+#include <isl/version.h>
+#include <dlfcn.h>
+
+#define DYNSYMS \
+ DYNSYM (isl_aff_add_coefficient_si); \
+ DYNSYM (isl_aff_free); \
+ DYNSYM (isl_aff_get_space); \
+ DYNSYM (isl_aff_set_coefficient_si); \
+ DYNSYM (isl_aff_set_constant_si); \
+ DYNSYM (isl_aff_zero_on_domain); \
+ /* DYNSYM (isl_band_free); */ \
+ /* DYNSYM (isl_band_get_children); */ \
+ /* DYNSYM (isl_band_get_partial_schedule); */ \
+ /* DYNSYM (isl_band_has_children); */ \
+ /* DYNSYM (isl_band_list_free); */ \
+ /* DYNSYM (isl_band_list_get_band); */ \
+ /* DYNSYM (isl_band_list_get_ctx); */ \
+ /* DYNSYM (isl_band_list_n_band); */ \
+ /* DYNSYM (isl_band_n_member); */ \
+ DYNSYM (isl_basic_map_add_constraint); \
+ DYNSYM (isl_basic_map_project_out); \
+ DYNSYM (isl_basic_map_universe); \
+ DYNSYM (isl_constraint_set_coefficient_si); \
+ DYNSYM (isl_constraint_set_constant_si); \
+ DYNSYM (isl_ctx_alloc); \
+ DYNSYM (isl_ctx_free); \
+ DYNSYM (isl_equality_alloc); \
+ DYNSYM (isl_id_alloc); \
+ DYNSYM (isl_id_copy); \
+ DYNSYM (isl_id_free); \
+ DYNSYM (isl_inequality_alloc); \
+ DYNSYM (isl_local_space_copy); \
+ DYNSYM (isl_local_space_free); \
+ DYNSYM (isl_local_space_from_space); \
+ DYNSYM (isl_local_space_range); \
+ DYNSYM (isl_map_add_constraint); \
+ DYNSYM (isl_map_add_dims); \
+ DYNSYM (isl_map_align_params); \
+ DYNSYM (isl_map_apply_range); \
+ DYNSYM (isl_map_copy); \
+ DYNSYM (isl_map_dim); \
+ DYNSYM (isl_map_dump); \
+ DYNSYM (isl_map_equate); \
+ DYNSYM (isl_map_fix_si); \
+ DYNSYM (isl_map_flat_product); \
+ DYNSYM (isl_map_flat_range_product); \
+ DYNSYM (isl_map_free); \
+ DYNSYM (isl_map_from_basic_map); \
+ DYNSYM (isl_map_from_pw_aff); \
+ DYNSYM (isl_map_from_union_map); \
+ DYNSYM (isl_map_get_ctx); \
+ DYNSYM (isl_map_get_space); \
+ DYNSYM (isl_map_get_tuple_id); \
+ DYNSYM (isl_map_insert_dims); \
+ DYNSYM (isl_map_intersect); \
+ DYNSYM (isl_map_intersect_domain); \
+ DYNSYM (isl_map_intersect_range); \
+ DYNSYM (isl_map_is_empty); \
+ DYNSYM (isl_map_lex_ge); \
+ DYNSYM (isl_map_lex_le); \
+ /* DYNSYM (isl_map_n_out); */ \
+ DYNSYM (isl_map_range); \
+ DYNSYM (isl_map_set_tuple_id); \
+ DYNSYM (isl_map_universe); \
+ DYNSYM (isl_options_set_on_error); \
+ DYNSYM (isl_options_set_schedule_serialize_sccs); \
+ DYNSYM (isl_printer_set_yaml_style); \
+ DYNSYM (isl_options_set_schedule_max_constant_term); \
+ DYNSYM (isl_options_set_schedule_maximize_band_depth); \
+ DYNSYM (isl_printer_free); \
+ DYNSYM (isl_printer_print_aff); \
+ DYNSYM (isl_printer_print_constraint); \
+ DYNSYM (isl_printer_print_map); \
+ DYNSYM (isl_printer_print_set); \
+ DYNSYM (isl_printer_to_file); \
+ DYNSYM (isl_pw_aff_add); \
+ DYNSYM (isl_pw_aff_alloc); \
+ DYNSYM (isl_pw_aff_copy); \
+ DYNSYM (isl_pw_aff_eq_set); \
+ DYNSYM (isl_pw_aff_free); \
+ DYNSYM (isl_pw_aff_from_aff); \
+ DYNSYM (isl_pw_aff_ge_set); \
+ DYNSYM (isl_pw_aff_gt_set); \
+ DYNSYM (isl_pw_aff_is_cst); \
+ DYNSYM (isl_pw_aff_le_set); \
+ DYNSYM (isl_pw_aff_lt_set); \
+ DYNSYM (isl_pw_aff_mul); \
+ DYNSYM (isl_pw_aff_ne_set); \
+ DYNSYM (isl_pw_aff_nonneg_set); \
+ DYNSYM (isl_pw_aff_set_tuple_id); \
+ DYNSYM (isl_pw_aff_sub); \
+ DYNSYM (isl_pw_aff_zero_set); \
+ DYNSYM (isl_schedule_free); \
+ /* DYNSYM (isl_schedule_get_band_forest); */ \
+ DYNSYM (isl_set_add_constraint); \
+ DYNSYM (isl_set_add_dims); \
+ DYNSYM (isl_set_apply); \
+ DYNSYM (isl_set_coalesce); \
+ DYNSYM (isl_set_copy); \
+ DYNSYM (isl_set_dim); \
+ DYNSYM (isl_set_fix_si); \
+ DYNSYM (isl_set_free); \
+ DYNSYM (isl_set_get_space); \
+ DYNSYM (isl_set_get_tuple_id); \
+ DYNSYM (isl_set_intersect); \
+ DYNSYM (isl_set_is_empty); \
+ DYNSYM (isl_set_n_dim); \
+ DYNSYM (isl_set_nat_universe); \
+ DYNSYM (isl_set_project_out); \
+ DYNSYM (isl_set_set_tuple_id); \
+ DYNSYM (isl_set_universe); \
+ DYNSYM (isl_space_add_dims); \
+ DYNSYM (isl_space_alloc); \
+ DYNSYM (isl_space_copy); \
+ DYNSYM (isl_space_dim); \
+ DYNSYM (isl_space_domain); \
+ DYNSYM (isl_space_find_dim_by_id); \
+ DYNSYM (isl_space_free); \
+ DYNSYM (isl_space_from_domain); \
+ DYNSYM (isl_space_get_tuple_id); \
+ DYNSYM (isl_space_params_alloc); \
+ DYNSYM (isl_space_range); \
+ DYNSYM (isl_space_set_alloc); \
+ DYNSYM (isl_space_set_dim_id); \
+ DYNSYM (isl_space_set_tuple_id); \
+ DYNSYM (isl_union_map_add_map); \
+ DYNSYM (isl_union_map_align_params); \
+ DYNSYM (isl_union_map_apply_domain); \
+ DYNSYM (isl_union_map_apply_range); \
+ DYNSYM (isl_union_map_compute_flow); \
+ DYNSYM (isl_union_map_copy); \
+ DYNSYM (isl_union_map_empty); \
+ DYNSYM (isl_union_map_flat_range_product); \
+ DYNSYM (isl_union_map_foreach_map); \
+ DYNSYM (isl_union_map_free); \
+ DYNSYM (isl_union_map_from_map); \
+ DYNSYM (isl_union_map_get_ctx); \
+ DYNSYM (isl_union_map_get_space); \
+ DYNSYM (isl_union_map_gist_domain); \
+ DYNSYM (isl_union_map_gist_range); \
+ DYNSYM (isl_union_map_intersect_domain); \
+ DYNSYM (isl_union_map_is_empty); \
+ DYNSYM (isl_union_map_subtract); \
+ DYNSYM (isl_union_map_union); \
+ DYNSYM (isl_union_set_add_set); \
+ DYNSYM (isl_union_set_compute_schedule); \
+ DYNSYM (isl_union_set_copy); \
+ DYNSYM (isl_union_set_empty); \
+ DYNSYM (isl_union_set_from_set); \
+ DYNSYM (isl_aff_add_constant_val); \
+ DYNSYM (isl_aff_get_coefficient_val); \
+ DYNSYM (isl_aff_get_ctx); \
+ DYNSYM (isl_aff_mod_val); \
+ DYNSYM (isl_ast_build_ast_from_schedule); \
+ DYNSYM (isl_ast_build_free); \
+ DYNSYM (isl_ast_build_from_context); \
+ DYNSYM (isl_ast_build_get_ctx); \
+ DYNSYM (isl_ast_build_get_schedule); \
+ DYNSYM (isl_ast_build_get_schedule_space); \
+ DYNSYM (isl_ast_build_set_before_each_for); \
+ DYNSYM (isl_ast_build_set_options); \
+ DYNSYM (isl_ast_expr_free); \
+ DYNSYM (isl_ast_expr_from_val); \
+ DYNSYM (isl_ast_expr_get_ctx); \
+ DYNSYM (isl_ast_expr_get_id); \
+ DYNSYM (isl_ast_expr_get_op_arg); \
+ DYNSYM (isl_ast_expr_get_op_n_arg); \
+ DYNSYM (isl_ast_expr_get_op_type); \
+ DYNSYM (isl_ast_expr_get_type); \
+ DYNSYM (isl_ast_expr_get_val); \
+ DYNSYM (isl_ast_expr_sub); \
+ DYNSYM (isl_ast_node_block_get_children); \
+ DYNSYM (isl_ast_node_for_get_body); \
+ DYNSYM (isl_ast_node_for_get_cond); \
+ DYNSYM (isl_ast_node_for_get_inc); \
+ DYNSYM (isl_ast_node_for_get_init); \
+ DYNSYM (isl_ast_node_for_get_iterator); \
+ DYNSYM (isl_ast_node_free); \
+ DYNSYM (isl_ast_node_get_annotation); \
+ DYNSYM (isl_ast_node_get_type); \
+ DYNSYM (isl_ast_node_if_get_cond); \
+ DYNSYM (isl_ast_node_if_get_else); \
+ DYNSYM (isl_ast_node_if_get_then); \
+ DYNSYM (isl_ast_node_list_free); \
+ DYNSYM (isl_ast_node_list_get_ast_node); \
+ DYNSYM (isl_ast_node_list_n_ast_node); \
+ DYNSYM (isl_ast_node_user_get_expr); \
+ DYNSYM (isl_constraint_set_coefficient_val); \
+ DYNSYM (isl_constraint_set_constant_val); \
+ DYNSYM (isl_id_get_user); \
+ DYNSYM (isl_local_space_get_ctx); \
+ DYNSYM (isl_map_fix_val); \
+ DYNSYM (isl_options_set_ast_build_atomic_upper_bound); \
+ DYNSYM (isl_printer_print_ast_node); \
+ DYNSYM (isl_printer_print_str); \
+ DYNSYM (isl_printer_set_output_format); \
+ DYNSYM (isl_pw_aff_mod_val); \
+ DYNSYM (isl_schedule_constraints_compute_schedule); \
+ DYNSYM (isl_schedule_constraints_on_domain); \
+ DYNSYM (isl_schedule_constraints_set_coincidence); \
+ DYNSYM (isl_schedule_constraints_set_proximity); \
+ DYNSYM (isl_schedule_constraints_set_validity); \
+ DYNSYM (isl_set_get_dim_id); \
+ DYNSYM (isl_set_max_val); \
+ DYNSYM (isl_set_min_val); \
+ DYNSYM (isl_set_params); \
+ DYNSYM (isl_space_align_params); \
+ DYNSYM (isl_space_map_from_domain_and_range); \
+ DYNSYM (isl_space_set_tuple_name); \
+ DYNSYM (isl_space_wrap); \
+ DYNSYM (isl_union_map_from_domain_and_range); \
+ DYNSYM (isl_union_map_range); \
+ DYNSYM (isl_union_set_union); \
+ DYNSYM (isl_union_set_universe); \
+ DYNSYM (isl_val_2exp); \
+ DYNSYM (isl_val_add_ui); \
+ DYNSYM (isl_val_copy); \
+ DYNSYM (isl_val_free); \
+ DYNSYM (isl_val_int_from_si); \
+ DYNSYM (isl_val_int_from_ui); \
+ DYNSYM (isl_val_mul); \
+ DYNSYM (isl_val_neg); \
+ DYNSYM (isl_val_sub); \
+ DYNSYM (isl_printer_print_union_map); \
+ DYNSYM (isl_pw_aff_get_ctx); \
+ DYNSYM (isl_val_is_int); \
+ DYNSYM (isl_ctx_get_max_operations); \
+ DYNSYM (isl_ctx_set_max_operations); \
+ DYNSYM (isl_ctx_last_error); \
+ DYNSYM (isl_ctx_reset_operations); \
+ DYNSYM (isl_map_coalesce); \
+ DYNSYM (isl_printer_print_schedule); \
+ DYNSYM (isl_set_set_dim_id); \
+ DYNSYM (isl_union_map_coalesce); \
+ DYNSYM (isl_multi_val_set_val); \
+ DYNSYM (isl_multi_val_zero); \
+ DYNSYM (isl_options_set_schedule_max_coefficient); \
+ DYNSYM (isl_options_set_tile_scale_tile_loops); \
+ DYNSYM (isl_schedule_copy); \
+ DYNSYM (isl_schedule_get_map); \
+ DYNSYM (isl_schedule_map_schedule_node_bottom_up); \
+ DYNSYM (isl_schedule_node_band_get_permutable); \
+ DYNSYM (isl_schedule_node_band_get_space); \
+ DYNSYM (isl_schedule_node_band_tile); \
+ DYNSYM (isl_schedule_node_child); \
+ DYNSYM (isl_schedule_node_free); \
+ DYNSYM (isl_schedule_node_get_child); \
+ DYNSYM (isl_schedule_node_get_ctx); \
+ DYNSYM (isl_schedule_node_get_type); \
+ DYNSYM (isl_schedule_node_n_children); \
+ DYNSYM (isl_union_map_is_equal); \
+ DYNSYM (isl_union_access_info_compute_flow); \
+ DYNSYM (isl_union_access_info_from_sink); \
+ DYNSYM (isl_union_access_info_set_may_source); \
+ DYNSYM (isl_union_access_info_set_must_source); \
+ DYNSYM (isl_union_access_info_set_schedule); \
+ DYNSYM (isl_union_flow_free); \
+ DYNSYM (isl_union_flow_get_may_dependence); \
+ DYNSYM (isl_union_flow_get_must_dependence); \
+ DYNSYM (isl_aff_var_on_domain); \
+ DYNSYM (isl_multi_aff_from_aff); \
+ DYNSYM (isl_schedule_get_ctx); \
+ DYNSYM (isl_multi_aff_set_tuple_id); \
+ DYNSYM (isl_multi_aff_dim); \
+ DYNSYM (isl_schedule_get_domain); \
+ DYNSYM (isl_union_set_is_empty); \
+ DYNSYM (isl_union_set_get_space); \
+ DYNSYM (isl_union_pw_multi_aff_empty); \
+ DYNSYM (isl_union_set_foreach_set); \
+ DYNSYM (isl_union_set_free); \
+ DYNSYM (isl_multi_union_pw_aff_from_union_pw_multi_aff); \
+ DYNSYM (isl_multi_union_pw_aff_apply_multi_aff); \
+ DYNSYM (isl_schedule_insert_partial_schedule); \
+ DYNSYM (isl_union_pw_multi_aff_free); \
+ DYNSYM (isl_pw_multi_aff_project_out_map); \
+ DYNSYM (isl_union_pw_multi_aff_add_pw_multi_aff); \
+ DYNSYM (isl_schedule_from_domain); \
+ DYNSYM (isl_schedule_sequence); \
+ DYNSYM (isl_ast_build_node_from_schedule); \
+ DYNSYM (isl_ast_node_mark_get_node); \
+ DYNSYM (isl_schedule_node_band_member_get_ast_loop_type); \
+ DYNSYM (isl_schedule_node_band_member_set_ast_loop_type); \
+ DYNSYM (isl_val_n_abs_num_chunks); \
+ DYNSYM (isl_val_get_abs_num_chunks); \
+ DYNSYM (isl_val_int_from_chunks); \
+ DYNSYM (isl_val_is_neg); \
+ DYNSYM (isl_version); \
+ DYNSYM (isl_options_get_on_error); \
+ DYNSYM (isl_ctx_reset_error);
+
+extern struct isl_pointers_s__
+{
+ bool inited;
+ void *h;
+#define DYNSYM(x) __typeof (x) *p_##x
+ DYNSYMS
+#undef DYNSYM
+} isl_pointers__;
+
+#define isl_aff_add_coefficient_si (*isl_pointers__.p_isl_aff_add_coefficient_si)
+#define isl_aff_free (*isl_pointers__.p_isl_aff_free)
+#define isl_aff_get_space (*isl_pointers__.p_isl_aff_get_space)
+#define isl_aff_set_coefficient_si (*isl_pointers__.p_isl_aff_set_coefficient_si)
+#define isl_aff_set_constant_si (*isl_pointers__.p_isl_aff_set_constant_si)
+#define isl_aff_zero_on_domain (*isl_pointers__.p_isl_aff_zero_on_domain)
+#define isl_band_free (*isl_pointers__.p_isl_band_free)
+#define isl_band_get_children (*isl_pointers__.p_isl_band_get_children)
+#define isl_band_get_partial_schedule (*isl_pointers__.p_isl_band_get_partial_schedule)
+#define isl_band_has_children (*isl_pointers__.p_isl_band_has_children)
+#define isl_band_list_free (*isl_pointers__.p_isl_band_list_free)
+#define isl_band_list_get_band (*isl_pointers__.p_isl_band_list_get_band)
+#define isl_band_list_get_ctx (*isl_pointers__.p_isl_band_list_get_ctx)
+#define isl_band_list_n_band (*isl_pointers__.p_isl_band_list_n_band)
+#define isl_band_n_member (*isl_pointers__.p_isl_band_n_member)
+#define isl_basic_map_add_constraint (*isl_pointers__.p_isl_basic_map_add_constraint)
+#define isl_basic_map_project_out (*isl_pointers__.p_isl_basic_map_project_out)
+#define isl_basic_map_universe (*isl_pointers__.p_isl_basic_map_universe)
+#define isl_constraint_set_coefficient_si (*isl_pointers__.p_isl_constraint_set_coefficient_si)
+#define isl_constraint_set_constant_si (*isl_pointers__.p_isl_constraint_set_constant_si)
+#define isl_ctx_alloc (*isl_pointers__.p_isl_ctx_alloc)
+#define isl_ctx_free (*isl_pointers__.p_isl_ctx_free)
+#define isl_equality_alloc (*isl_pointers__.p_isl_equality_alloc)
+#define isl_id_alloc (*isl_pointers__.p_isl_id_alloc)
+#define isl_id_copy (*isl_pointers__.p_isl_id_copy)
+#define isl_id_free (*isl_pointers__.p_isl_id_free)
+#define isl_inequality_alloc (*isl_pointers__.p_isl_inequality_alloc)
+#define isl_local_space_copy (*isl_pointers__.p_isl_local_space_copy)
+#define isl_local_space_free (*isl_pointers__.p_isl_local_space_free)
+#define isl_local_space_from_space (*isl_pointers__.p_isl_local_space_from_space)
+#define isl_local_space_range (*isl_pointers__.p_isl_local_space_range)
+#define isl_map_add_constraint (*isl_pointers__.p_isl_map_add_constraint)
+#define isl_map_add_dims (*isl_pointers__.p_isl_map_add_dims)
+#define isl_map_align_params (*isl_pointers__.p_isl_map_align_params)
+#define isl_map_apply_range (*isl_pointers__.p_isl_map_apply_range)
+#define isl_map_copy (*isl_pointers__.p_isl_map_copy)
+#define isl_map_dim (*isl_pointers__.p_isl_map_dim)
+#define isl_map_dump (*isl_pointers__.p_isl_map_dump)
+#define isl_map_equate (*isl_pointers__.p_isl_map_equate)
+#define isl_map_fix_si (*isl_pointers__.p_isl_map_fix_si)
+#define isl_map_flat_product (*isl_pointers__.p_isl_map_flat_product)
+#define isl_map_flat_range_product (*isl_pointers__.p_isl_map_flat_range_product)
+#define isl_map_free (*isl_pointers__.p_isl_map_free)
+#define isl_map_from_basic_map (*isl_pointers__.p_isl_map_from_basic_map)
+#define isl_map_from_pw_aff (*isl_pointers__.p_isl_map_from_pw_aff)
+#define isl_map_from_union_map (*isl_pointers__.p_isl_map_from_union_map)
+#define isl_map_get_ctx (*isl_pointers__.p_isl_map_get_ctx)
+#define isl_map_get_space (*isl_pointers__.p_isl_map_get_space)
+#define isl_map_get_tuple_id (*isl_pointers__.p_isl_map_get_tuple_id)
+#define isl_map_insert_dims (*isl_pointers__.p_isl_map_insert_dims)
+#define isl_map_intersect (*isl_pointers__.p_isl_map_intersect)
+#define isl_map_intersect_domain (*isl_pointers__.p_isl_map_intersect_domain)
+#define isl_map_intersect_range (*isl_pointers__.p_isl_map_intersect_range)
+#define isl_map_is_empty (*isl_pointers__.p_isl_map_is_empty)
+#define isl_map_lex_ge (*isl_pointers__.p_isl_map_lex_ge)
+#define isl_map_lex_le (*isl_pointers__.p_isl_map_lex_le)
+#define isl_map_n_out (*isl_pointers__.p_isl_map_n_out)
+#define isl_map_range (*isl_pointers__.p_isl_map_range)
+#define isl_map_set_tuple_id (*isl_pointers__.p_isl_map_set_tuple_id)
+#define isl_map_universe (*isl_pointers__.p_isl_map_universe)
+#define isl_options_set_on_error (*isl_pointers__.p_isl_options_set_on_error)
+#define isl_options_set_schedule_serialize_sccs (*isl_pointers__.p_isl_options_set_schedule_serialize_sccs)
+#define isl_printer_set_yaml_style (*isl_pointers__.p_isl_printer_set_yaml_style)
+#define isl_options_set_schedule_max_constant_term (*isl_pointers__.p_isl_options_set_schedule_max_constant_term)
+#define isl_options_set_schedule_maximize_band_depth (*isl_pointers__.p_isl_options_set_schedule_maximize_band_depth)
+#define isl_printer_free (*isl_pointers__.p_isl_printer_free)
+#define isl_printer_print_aff (*isl_pointers__.p_isl_printer_print_aff)
+#define isl_printer_print_constraint (*isl_pointers__.p_isl_printer_print_constraint)
+#define isl_printer_print_map (*isl_pointers__.p_isl_printer_print_map)
+#define isl_printer_print_set (*isl_pointers__.p_isl_printer_print_set)
+#define isl_printer_to_file (*isl_pointers__.p_isl_printer_to_file)
+#define isl_pw_aff_add (*isl_pointers__.p_isl_pw_aff_add)
+#define isl_pw_aff_alloc (*isl_pointers__.p_isl_pw_aff_alloc)
+#define isl_pw_aff_copy (*isl_pointers__.p_isl_pw_aff_copy)
+#define isl_pw_aff_eq_set (*isl_pointers__.p_isl_pw_aff_eq_set)
+#define isl_pw_aff_free (*isl_pointers__.p_isl_pw_aff_free)
+#define isl_pw_aff_from_aff (*isl_pointers__.p_isl_pw_aff_from_aff)
+#define isl_pw_aff_ge_set (*isl_pointers__.p_isl_pw_aff_ge_set)
+#define isl_pw_aff_gt_set (*isl_pointers__.p_isl_pw_aff_gt_set)
+#define isl_pw_aff_is_cst (*isl_pointers__.p_isl_pw_aff_is_cst)
+#define isl_pw_aff_le_set (*isl_pointers__.p_isl_pw_aff_le_set)
+#define isl_pw_aff_lt_set (*isl_pointers__.p_isl_pw_aff_lt_set)
+#define isl_pw_aff_mul (*isl_pointers__.p_isl_pw_aff_mul)
+#define isl_pw_aff_ne_set (*isl_pointers__.p_isl_pw_aff_ne_set)
+#define isl_pw_aff_nonneg_set (*isl_pointers__.p_isl_pw_aff_nonneg_set)
+#define isl_pw_aff_set_tuple_id (*isl_pointers__.p_isl_pw_aff_set_tuple_id)
+#define isl_pw_aff_sub (*isl_pointers__.p_isl_pw_aff_sub)
+#define isl_pw_aff_zero_set (*isl_pointers__.p_isl_pw_aff_zero_set)
+#define isl_schedule_free (*isl_pointers__.p_isl_schedule_free)
+#define isl_schedule_get_band_forest (*isl_pointers__.p_isl_schedule_get_band_forest)
+#define isl_set_add_constraint (*isl_pointers__.p_isl_set_add_constraint)
+#define isl_set_add_dims (*isl_pointers__.p_isl_set_add_dims)
+#define isl_set_apply (*isl_pointers__.p_isl_set_apply)
+#define isl_set_coalesce (*isl_pointers__.p_isl_set_coalesce)
+#define isl_set_copy (*isl_pointers__.p_isl_set_copy)
+#define isl_set_dim (*isl_pointers__.p_isl_set_dim)
+#define isl_set_fix_si (*isl_pointers__.p_isl_set_fix_si)
+#define isl_set_free (*isl_pointers__.p_isl_set_free)
+#define isl_set_get_space (*isl_pointers__.p_isl_set_get_space)
+#define isl_set_get_tuple_id (*isl_pointers__.p_isl_set_get_tuple_id)
+#define isl_set_intersect (*isl_pointers__.p_isl_set_intersect)
+#define isl_set_is_empty (*isl_pointers__.p_isl_set_is_empty)
+#define isl_set_n_dim (*isl_pointers__.p_isl_set_n_dim)
+#define isl_set_nat_universe (*isl_pointers__.p_isl_set_nat_universe)
+#define isl_set_project_out (*isl_pointers__.p_isl_set_project_out)
+#define isl_set_set_tuple_id (*isl_pointers__.p_isl_set_set_tuple_id)
+#define isl_set_universe (*isl_pointers__.p_isl_set_universe)
+#define isl_space_add_dims (*isl_pointers__.p_isl_space_add_dims)
+#define isl_space_alloc (*isl_pointers__.p_isl_space_alloc)
+#define isl_space_copy (*isl_pointers__.p_isl_space_copy)
+#define isl_space_dim (*isl_pointers__.p_isl_space_dim)
+#define isl_space_domain (*isl_pointers__.p_isl_space_domain)
+#define isl_space_find_dim_by_id (*isl_pointers__.p_isl_space_find_dim_by_id)
+#define isl_space_free (*isl_pointers__.p_isl_space_free)
+#define isl_space_from_domain (*isl_pointers__.p_isl_space_from_domain)
+#define isl_space_get_tuple_id (*isl_pointers__.p_isl_space_get_tuple_id)
+#define isl_space_params_alloc (*isl_pointers__.p_isl_space_params_alloc)
+#define isl_space_range (*isl_pointers__.p_isl_space_range)
+#define isl_space_set_alloc (*isl_pointers__.p_isl_space_set_alloc)
+#define isl_space_set_dim_id (*isl_pointers__.p_isl_space_set_dim_id)
+#define isl_space_set_tuple_id (*isl_pointers__.p_isl_space_set_tuple_id)
+#define isl_union_map_add_map (*isl_pointers__.p_isl_union_map_add_map)
+#define isl_union_map_align_params (*isl_pointers__.p_isl_union_map_align_params)
+#define isl_union_map_apply_domain (*isl_pointers__.p_isl_union_map_apply_domain)
+#define isl_union_map_apply_range (*isl_pointers__.p_isl_union_map_apply_range)
+#define isl_union_map_compute_flow (*isl_pointers__.p_isl_union_map_compute_flow)
+#define isl_union_map_copy (*isl_pointers__.p_isl_union_map_copy)
+#define isl_union_map_empty (*isl_pointers__.p_isl_union_map_empty)
+#define isl_union_map_flat_range_product (*isl_pointers__.p_isl_union_map_flat_range_product)
+#define isl_union_map_foreach_map (*isl_pointers__.p_isl_union_map_foreach_map)
+#define isl_union_map_free (*isl_pointers__.p_isl_union_map_free)
+#define isl_union_map_from_map (*isl_pointers__.p_isl_union_map_from_map)
+#define isl_union_map_get_ctx (*isl_pointers__.p_isl_union_map_get_ctx)
+#define isl_union_map_get_space (*isl_pointers__.p_isl_union_map_get_space)
+#define isl_union_map_gist_domain (*isl_pointers__.p_isl_union_map_gist_domain)
+#define isl_union_map_gist_range (*isl_pointers__.p_isl_union_map_gist_range)
+#define isl_union_map_intersect_domain (*isl_pointers__.p_isl_union_map_intersect_domain)
+#define isl_union_map_is_empty (*isl_pointers__.p_isl_union_map_is_empty)
+#define isl_union_map_subtract (*isl_pointers__.p_isl_union_map_subtract)
+#define isl_union_map_union (*isl_pointers__.p_isl_union_map_union)
+#define isl_union_set_add_set (*isl_pointers__.p_isl_union_set_add_set)
+#define isl_union_set_compute_schedule (*isl_pointers__.p_isl_union_set_compute_schedule)
+#define isl_union_set_copy (*isl_pointers__.p_isl_union_set_copy)
+#define isl_union_set_empty (*isl_pointers__.p_isl_union_set_empty)
+#define isl_union_set_from_set (*isl_pointers__.p_isl_union_set_from_set)
+#define isl_aff_add_constant_val (*isl_pointers__.p_isl_aff_add_constant_val)
+#define isl_aff_get_coefficient_val (*isl_pointers__.p_isl_aff_get_coefficient_val)
+#define isl_aff_get_ctx (*isl_pointers__.p_isl_aff_get_ctx)
+#define isl_aff_mod_val (*isl_pointers__.p_isl_aff_mod_val)
+#define isl_ast_build_ast_from_schedule (*isl_pointers__.p_isl_ast_build_ast_from_schedule)
+#define isl_ast_build_free (*isl_pointers__.p_isl_ast_build_free)
+#define isl_ast_build_from_context (*isl_pointers__.p_isl_ast_build_from_context)
+#define isl_ast_build_get_ctx (*isl_pointers__.p_isl_ast_build_get_ctx)
+#define isl_ast_build_get_schedule (*isl_pointers__.p_isl_ast_build_get_schedule)
+#define isl_ast_build_get_schedule_space (*isl_pointers__.p_isl_ast_build_get_schedule_space)
+#define isl_ast_build_set_before_each_for (*isl_pointers__.p_isl_ast_build_set_before_each_for)
+#define isl_ast_build_set_options (*isl_pointers__.p_isl_ast_build_set_options)
+#define isl_ast_expr_free (*isl_pointers__.p_isl_ast_expr_free)
+#define isl_ast_expr_from_val (*isl_pointers__.p_isl_ast_expr_from_val)
+#define isl_ast_expr_get_ctx (*isl_pointers__.p_isl_ast_expr_get_ctx)
+#define isl_ast_expr_get_id (*isl_pointers__.p_isl_ast_expr_get_id)
+#define isl_ast_expr_get_op_arg (*isl_pointers__.p_isl_ast_expr_get_op_arg)
+#define isl_ast_expr_get_op_n_arg (*isl_pointers__.p_isl_ast_expr_get_op_n_arg)
+#define isl_ast_expr_get_op_type (*isl_pointers__.p_isl_ast_expr_get_op_type)
+#define isl_ast_expr_get_type (*isl_pointers__.p_isl_ast_expr_get_type)
+#define isl_ast_expr_get_val (*isl_pointers__.p_isl_ast_expr_get_val)
+#define isl_ast_expr_sub (*isl_pointers__.p_isl_ast_expr_sub)
+#define isl_ast_node_block_get_children (*isl_pointers__.p_isl_ast_node_block_get_children)
+#define isl_ast_node_for_get_body (*isl_pointers__.p_isl_ast_node_for_get_body)
+#define isl_ast_node_for_get_cond (*isl_pointers__.p_isl_ast_node_for_get_cond)
+#define isl_ast_node_for_get_inc (*isl_pointers__.p_isl_ast_node_for_get_inc)
+#define isl_ast_node_for_get_init (*isl_pointers__.p_isl_ast_node_for_get_init)
+#define isl_ast_node_for_get_iterator (*isl_pointers__.p_isl_ast_node_for_get_iterator)
+#define isl_ast_node_free (*isl_pointers__.p_isl_ast_node_free)
+#define isl_ast_node_get_annotation (*isl_pointers__.p_isl_ast_node_get_annotation)
+#define isl_ast_node_get_type (*isl_pointers__.p_isl_ast_node_get_type)
+#define isl_ast_node_if_get_cond (*isl_pointers__.p_isl_ast_node_if_get_cond)
+#define isl_ast_node_if_get_else (*isl_pointers__.p_isl_ast_node_if_get_else)
+#define isl_ast_node_if_get_then (*isl_pointers__.p_isl_ast_node_if_get_then)
+#define isl_ast_node_list_free (*isl_pointers__.p_isl_ast_node_list_free)
+#define isl_ast_node_list_get_ast_node (*isl_pointers__.p_isl_ast_node_list_get_ast_node)
+#define isl_ast_node_list_n_ast_node (*isl_pointers__.p_isl_ast_node_list_n_ast_node)
+#define isl_ast_node_user_get_expr (*isl_pointers__.p_isl_ast_node_user_get_expr)
+#define isl_constraint_set_coefficient_val (*isl_pointers__.p_isl_constraint_set_coefficient_val)
+#define isl_constraint_set_constant_val (*isl_pointers__.p_isl_constraint_set_constant_val)
+#define isl_id_get_user (*isl_pointers__.p_isl_id_get_user)
+#define isl_local_space_get_ctx (*isl_pointers__.p_isl_local_space_get_ctx)
+#define isl_map_fix_val (*isl_pointers__.p_isl_map_fix_val)
+#define isl_options_set_ast_build_atomic_upper_bound (*isl_pointers__.p_isl_options_set_ast_build_atomic_upper_bound)
+#define isl_printer_print_ast_node (*isl_pointers__.p_isl_printer_print_ast_node)
+#define isl_printer_print_str (*isl_pointers__.p_isl_printer_print_str)
+#define isl_printer_set_output_format (*isl_pointers__.p_isl_printer_set_output_format)
+#define isl_pw_aff_mod_val (*isl_pointers__.p_isl_pw_aff_mod_val)
+#define isl_schedule_constraints_compute_schedule (*isl_pointers__.p_isl_schedule_constraints_compute_schedule)
+#define isl_schedule_constraints_on_domain (*isl_pointers__.p_isl_schedule_constraints_on_domain)
+#define isl_schedule_constraints_set_coincidence (*isl_pointers__.p_isl_schedule_constraints_set_coincidence)
+#define isl_schedule_constraints_set_proximity (*isl_pointers__.p_isl_schedule_constraints_set_proximity)
+#define isl_schedule_constraints_set_validity (*isl_pointers__.p_isl_schedule_constraints_set_validity)
+#define isl_set_get_dim_id (*isl_pointers__.p_isl_set_get_dim_id)
+#define isl_set_max_val (*isl_pointers__.p_isl_set_max_val)
+#define isl_set_min_val (*isl_pointers__.p_isl_set_min_val)
+#define isl_set_params (*isl_pointers__.p_isl_set_params)
+#define isl_space_align_params (*isl_pointers__.p_isl_space_align_params)
+#define isl_space_map_from_domain_and_range (*isl_pointers__.p_isl_space_map_from_domain_and_range)
+#define isl_space_set_tuple_name (*isl_pointers__.p_isl_space_set_tuple_name)
+#define isl_space_wrap (*isl_pointers__.p_isl_space_wrap)
+#define isl_union_map_from_domain_and_range (*isl_pointers__.p_isl_union_map_from_domain_and_range)
+#define isl_union_map_range (*isl_pointers__.p_isl_union_map_range)
+#define isl_union_set_union (*isl_pointers__.p_isl_union_set_union)
+#define isl_union_set_universe (*isl_pointers__.p_isl_union_set_universe)
+#define isl_val_2exp (*isl_pointers__.p_isl_val_2exp)
+#define isl_val_add_ui (*isl_pointers__.p_isl_val_add_ui)
+#define isl_val_copy (*isl_pointers__.p_isl_val_copy)
+#define isl_val_free (*isl_pointers__.p_isl_val_free)
+#define isl_val_int_from_si (*isl_pointers__.p_isl_val_int_from_si)
+#define isl_val_int_from_ui (*isl_pointers__.p_isl_val_int_from_ui)
+#define isl_val_mul (*isl_pointers__.p_isl_val_mul)
+#define isl_val_neg (*isl_pointers__.p_isl_val_neg)
+#define isl_val_sub (*isl_pointers__.p_isl_val_sub)
+#define isl_printer_print_union_map (*isl_pointers__.p_isl_printer_print_union_map)
+#define isl_pw_aff_get_ctx (*isl_pointers__.p_isl_pw_aff_get_ctx)
+#define isl_val_is_int (*isl_pointers__.p_isl_val_is_int)
+#define isl_ctx_get_max_operations (*isl_pointers__.p_isl_ctx_get_max_operations)
+#define isl_ctx_set_max_operations (*isl_pointers__.p_isl_ctx_set_max_operations)
+#define isl_ctx_last_error (*isl_pointers__.p_isl_ctx_last_error)
+#define isl_ctx_reset_operations (*isl_pointers__.p_isl_ctx_reset_operations)
+#define isl_map_coalesce (*isl_pointers__.p_isl_map_coalesce)
+#define isl_printer_print_schedule (*isl_pointers__.p_isl_printer_print_schedule)
+#define isl_set_set_dim_id (*isl_pointers__.p_isl_set_set_dim_id)
+#define isl_union_map_coalesce (*isl_pointers__.p_isl_union_map_coalesce)
+#define isl_multi_val_set_val (*isl_pointers__.p_isl_multi_val_set_val)
+#define isl_multi_val_zero (*isl_pointers__.p_isl_multi_val_zero)
+#define isl_options_set_schedule_max_coefficient (*isl_pointers__.p_isl_options_set_schedule_max_coefficient)
+#define isl_options_set_tile_scale_tile_loops (*isl_pointers__.p_isl_options_set_tile_scale_tile_loops)
+#define isl_schedule_copy (*isl_pointers__.p_isl_schedule_copy)
+#define isl_schedule_get_map (*isl_pointers__.p_isl_schedule_get_map)
+#define isl_schedule_map_schedule_node_bottom_up (*isl_pointers__.p_isl_schedule_map_schedule_node_bottom_up)
+#define isl_schedule_node_band_get_permutable (*isl_pointers__.p_isl_schedule_node_band_get_permutable)
+#define isl_schedule_node_band_get_space (*isl_pointers__.p_isl_schedule_node_band_get_space)
+#define isl_schedule_node_band_tile (*isl_pointers__.p_isl_schedule_node_band_tile)
+#define isl_schedule_node_child (*isl_pointers__.p_isl_schedule_node_child)
+#define isl_schedule_node_free (*isl_pointers__.p_isl_schedule_node_free)
+#define isl_schedule_node_get_child (*isl_pointers__.p_isl_schedule_node_get_child)
+#define isl_schedule_node_get_ctx (*isl_pointers__.p_isl_schedule_node_get_ctx)
+#define isl_schedule_node_get_type (*isl_pointers__.p_isl_schedule_node_get_type)
+#define isl_schedule_node_n_children (*isl_pointers__.p_isl_schedule_node_n_children)
+#define isl_union_map_is_equal (*isl_pointers__.p_isl_union_map_is_equal)
+#define isl_union_access_info_compute_flow (*isl_pointers__.p_isl_union_access_info_compute_flow)
+#define isl_union_access_info_from_sink (*isl_pointers__.p_isl_union_access_info_from_sink)
+#define isl_union_access_info_set_may_source (*isl_pointers__.p_isl_union_access_info_set_may_source)
+#define isl_union_access_info_set_must_source (*isl_pointers__.p_isl_union_access_info_set_must_source)
+#define isl_union_access_info_set_schedule (*isl_pointers__.p_isl_union_access_info_set_schedule)
+#define isl_union_flow_free (*isl_pointers__.p_isl_union_flow_free)
+#define isl_union_flow_get_may_dependence (*isl_pointers__.p_isl_union_flow_get_may_dependence)
+#define isl_union_flow_get_must_dependence (*isl_pointers__.p_isl_union_flow_get_must_dependence)
+#define isl_aff_var_on_domain (*isl_pointers__.p_isl_aff_var_on_domain)
+#define isl_multi_aff_from_aff (*isl_pointers__.p_isl_multi_aff_from_aff)
+#define isl_schedule_get_ctx (*isl_pointers__.p_isl_schedule_get_ctx)
+#define isl_multi_aff_set_tuple_id (*isl_pointers__.p_isl_multi_aff_set_tuple_id)
+#define isl_multi_aff_dim (*isl_pointers__.p_isl_multi_aff_dim)
+#define isl_schedule_get_domain (*isl_pointers__.p_isl_schedule_get_domain)
+#define isl_union_set_is_empty (*isl_pointers__.p_isl_union_set_is_empty)
+#define isl_union_set_get_space (*isl_pointers__.p_isl_union_set_get_space)
+#define isl_union_pw_multi_aff_empty (*isl_pointers__.p_isl_union_pw_multi_aff_empty)
+#define isl_union_set_foreach_set (*isl_pointers__.p_isl_union_set_foreach_set)
+#define isl_union_set_free (*isl_pointers__.p_isl_union_set_free)
+#define isl_multi_union_pw_aff_from_union_pw_multi_aff (*isl_pointers__.p_isl_multi_union_pw_aff_from_union_pw_multi_aff)
+#define isl_multi_union_pw_aff_apply_multi_aff (*isl_pointers__.p_isl_multi_union_pw_aff_apply_multi_aff)
+#define isl_schedule_insert_partial_schedule (*isl_pointers__.p_isl_schedule_insert_partial_schedule)
+#define isl_union_pw_multi_aff_free (*isl_pointers__.p_isl_union_pw_multi_aff_free)
+#define isl_pw_multi_aff_project_out_map (*isl_pointers__.p_isl_pw_multi_aff_project_out_map)
+#define isl_union_pw_multi_aff_add_pw_multi_aff (*isl_pointers__.p_isl_union_pw_multi_aff_add_pw_multi_aff)
+#define isl_schedule_from_domain (*isl_pointers__.p_isl_schedule_from_domain)
+#define isl_schedule_sequence (*isl_pointers__.p_isl_schedule_sequence)
+#define isl_ast_build_node_from_schedule (*isl_pointers__.p_isl_ast_build_node_from_schedule)
+#define isl_ast_node_mark_get_node (*isl_pointers__.p_isl_ast_node_mark_get_node)
+#define isl_schedule_node_band_member_get_ast_loop_type (*isl_pointers__.p_isl_schedule_node_band_member_get_ast_loop_type)
+#define isl_schedule_node_band_member_set_ast_loop_type (*isl_pointers__.p_isl_schedule_node_band_member_set_ast_loop_type)
+#define isl_val_n_abs_num_chunks (*isl_pointers__.p_isl_val_n_abs_num_chunks)
+#define isl_val_get_abs_num_chunks (*isl_pointers__.p_isl_val_get_abs_num_chunks)
+#define isl_val_int_from_chunks (*isl_pointers__.p_isl_val_int_from_chunks)
+#define isl_val_is_neg (*isl_pointers__.p_isl_val_is_neg)
+#define isl_version (*isl_pointers__.p_isl_version)
+#define isl_options_get_on_error (*isl_pointers__.p_isl_options_get_on_error)
+#define isl_ctx_reset_error (*isl_pointers__.p_isl_ctx_reset_error)
+
typedef struct poly_dr *poly_dr_p;
typedef struct poly_bb *poly_bb_p;
@@ -448,5 +1033,6 @@ extern tree cached_scalar_evolution_in_r
extern void dot_all_sese (FILE *, vec<sese_l> &);
extern void dot_sese (sese_l &);
extern void dot_cfg ();
+extern const char *get_isl_version (bool);
#endif
--- gcc/graphite.cc.jj 2015-11-04 14:15:32.000000000 +0100
+++ gcc/graphite.cc 2015-11-04 14:56:02.645536409 +0100
@@ -60,6 +60,35 @@ along with GCC; see the file COPYING3.
#include "tree-ssa-propagate.h"
#include "graphite.h"
+__typeof (isl_pointers__) isl_pointers__;
+
+static bool
+init_isl_pointers (void)
+{
+ void *h;
+
+ if (isl_pointers__.inited)
+ return isl_pointers__.h != NULL;
+ h = dlopen ("libisl.so.23", RTLD_LAZY);
+ isl_pointers__.h = h;
+ if (h == NULL)
+ return false;
+#define DYNSYM(x) \
+ do \
+ { \
+ union { __typeof (isl_pointers__.p_##x) p; void *q; } u; \
+ u.q = dlsym (h, #x); \
+ if (u.q == NULL) \
+ return false; \
+ isl_pointers__.p_##x = u.p; \
+ } \
+ while (0)
+ DYNSYMS
+#undef DYNSYM
+ isl_pointers__.inited = true;
+ return true;
+}
+
/* Print global statistics to FILE. */
static void
@@ -424,6 +453,15 @@ graphite_transform_loops (void)
if (parallelized_function_p (cfun->decl))
return;
+ if (number_of_loops (cfun) <= 1)
+ return;
+
+ if (!init_isl_pointers ())
+ {
+ sorry ("Graphite loop optimizations cannot be used");
+ return;
+ }
+
calculate_dominance_info (CDI_DOMINATORS);
/* We rely on post-dominators during merging of SESE regions so those
@@ -519,6 +557,14 @@ graphite_transform_loops (void)
}
}
+const char *
+get_isl_version (bool force)
+{
+ if (force)
+ init_isl_pointers ();
+ return (isl_pointers__.inited && isl_version) ? isl_version () : "none";
+}
+
#else /* If isl is not available: #ifndef HAVE_isl. */
static void
--- gcc/toplev.cc.jj 2017-02-19 13:02:31.000000000 +0100
+++ gcc/toplev.cc 2017-02-19 16:50:25.536301350 +0100
@@ -94,6 +94,7 @@ along with GCC; see the file COPYING3.
#ifdef HAVE_isl
#include <isl/version.h>
+extern const char *get_isl_version (bool);
#endif
static void general_init (const char *, bool);
@@ -683,7 +684,7 @@ print_version (FILE *file, const char *i
#ifndef HAVE_isl
"none"
#else
- isl_version ()
+ get_isl_version (*indent == 0)
#endif
);
if (strcmp (GCC_GMP_STRINGIFY_VERSION, gmp_version))

View File

@ -0,0 +1,71 @@
2011-04-04 Jakub Jelinek <jakub@redhat.com>
* toplev.cc (toplev_main_argv): New variable.
(toplev_main): Initialize it.
* graphite.cc (init_isl_pointers): Load libisl.so.23 from gcc's private
directory.
--- gcc/toplev.cc.jj 2008-12-09 23:59:10.000000000 +0100
+++ gcc/toplev.cc 2009-01-27 14:33:52.000000000 +0100
@@ -113,6 +113,8 @@ static void finalize (bool);
static void crash_signal (int) ATTRIBUTE_NORETURN;
static void compile_file (void);
+const char **toplev_main_argv;
+
/* Decoded options, and number of such options. */
struct cl_decoded_option *save_decoded_options;
unsigned int save_decoded_options_count;
@@ -2239,6 +2241,8 @@ toplev::main (int argc, char **argv)
expandargv (&argc, &argv);
+ toplev_main_argv = CONST_CAST2 (const char **, char **, argv);
+
/* Initialization of GCC's environment, and diagnostics. */
general_init (argv[0], m_init_signals);
--- gcc/graphite.cc.jj 2010-12-01 10:24:32.000000000 -0500
+++ gcc/graphite.cc 2010-12-01 11:46:07.832118193 -0500
@@ -64,11 +64,39 @@ __typeof (isl_pointers__) isl_pointers__
static bool
init_isl_pointers (void)
{
- void *h;
+ void *h = NULL;
+ extern const char **toplev_main_argv;
+ char *buf, *p;
+ size_t len;
if (isl_pointers__.inited)
return isl_pointers__.h != NULL;
- h = dlopen ("libisl.so.23", RTLD_LAZY);
+ len = progname - toplev_main_argv[0];
+ buf = XALLOCAVAR (char, len + sizeof "libisl.so.23");
+ memcpy (buf, toplev_main_argv[0], len);
+ strcpy (buf + len, "libisl.so.23");
+ len += sizeof "libisl.so.23";
+ p = strstr (buf, "/libexec/");
+ if (p != NULL)
+ {
+ while (1)
+ {
+ char *q = strstr (p + 8, "/libexec/");
+ if (q == NULL)
+ break;
+ p = q;
+ }
+ memmove (p + 4, p + 8, len - (p + 8 - buf));
+ h = dlopen (buf, RTLD_LAZY);
+ if (h == NULL)
+ {
+ len = progname - toplev_main_argv[0];
+ memcpy (buf, toplev_main_argv[0], len);
+ strcpy (buf + len, "libisl.so.23");
+ }
+ }
+ if (h == NULL)
+ h = dlopen (buf, RTLD_LAZY);
isl_pointers__.h = h;
if (h == NULL)
return false;

View File

@ -0,0 +1,754 @@
--- libgfortran/Makefile.am.jj 2024-04-26 11:47:02.740161941 +0200
+++ libgfortran/Makefile.am 2024-07-19 16:22:00.633418680 +0200
@@ -50,6 +50,7 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdi
$(lt_host_flags)
toolexeclib_LTLIBRARIES = libgfortran.la
+noinst_LTLIBRARIES = libgfortran_nonshared80.la libgfortran_nonshared110.la
toolexeclib_DATA = libgfortran.spec
libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
@@ -1128,6 +1129,98 @@ BUILT_SOURCES=$(gfor_built_src) $(gfor_b
libgfortran_la_SOURCES = $(gfor_src) $(gfor_built_src) $(gfor_io_src) \
$(gfor_helper_src) $(gfor_ieee_src) $(gfor_io_headers) $(gfor_specific_src)
+$(patsubst %.c,%.lo,$(nonshared_generated_C_SRC) $(nonshared)): \
+nonshared-%.lo: $(srcdir)/generated/%.c
+ $(LTCOMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.c,%.o,$(nonshared_generated_C_SRC) $(nonshared)): \
+nonshared-%.o: $(srcdir)/generated/%.c
+ $(COMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.c,%.lo,$(nonshared_intrinsics_C_SRC) $(nonshared)): \
+nonshared-%.lo: $(srcdir)/intrinsics/%.c
+ $(LTCOMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.c,%.o,$(nonshared_intrinsics_C_SRC) $(nonshared)): \
+nonshared-%.o: $(srcdir)/intrinsics/%.c
+ $(COMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.c,%.lo,$(nonshared_runtime_C_SRC) $(nonshared)): \
+nonshared-%.lo: $(srcdir)/runtime/%.c
+ $(LTCOMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.c,%.o,$(nonshared_runtime_C_SRC) $(nonshared)): \
+nonshared-%.o: $(srcdir)/runtime/%.c
+ $(COMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.f90,%.lo,$(nonshared_intrinsics_f90_SRC) $(nonshared)): \
+nonshared-%.lo: $(srcdir)/intrinsics/%.f90
+ $(LTPPFCCOMPILE) -c -o $@ $< -fallow-leading-underscore
+
+$(patsubst %.f90,%.o,$(nonshared_intrinsics_f90_SRC) $(nonshared)): \
+nonshared-%.o: $(srcdir)/intrinsics/%.f90
+ $(PPFCCOMPILE) -c -o $@ $< -fallow-leading-underscore
+
+nonshared_runtime_C_SRC = \
+nonshared-ISO_Fortran_binding.c
+
+nonshared_io_C_SRC = \
+$(srcdir)/io/nonshared-transfer.c
+
+nonshared_generated_C_SRC = \
+nonshared-findloc0_i1.c \
+nonshared-findloc0_i2.c \
+nonshared-findloc0_i4.c \
+nonshared-findloc0_i8.c \
+nonshared-findloc0_i16.c \
+nonshared-findloc0_r4.c \
+nonshared-findloc0_r8.c \
+nonshared-findloc0_r10.c \
+nonshared-findloc0_r16.c \
+nonshared-findloc0_c4.c \
+nonshared-findloc0_c8.c \
+nonshared-findloc0_c10.c \
+nonshared-findloc0_c16.c \
+nonshared-findloc0_s1.c \
+nonshared-findloc0_s4.c \
+nonshared-findloc1_i1.c \
+nonshared-findloc1_i2.c \
+nonshared-findloc1_i4.c \
+nonshared-findloc1_i8.c \
+nonshared-findloc1_i16.c \
+nonshared-findloc1_r4.c \
+nonshared-findloc1_r8.c \
+nonshared-findloc1_r10.c \
+nonshared-findloc1_r16.c \
+nonshared-findloc1_c4.c \
+nonshared-findloc1_c8.c \
+nonshared-findloc1_c10.c \
+nonshared-findloc1_c16.c \
+nonshared-findloc1_s1.c \
+nonshared-findloc1_s4.c \
+nonshared-findloc2_s1.c \
+nonshared-findloc2_s4.c
+
+nonshared_intrinsics_C_SRC = \
+nonshared-is_contiguous.c \
+nonshared-trigd.c
+
+nonshared_intrinsics_f90_SRC = \
+nonshared-random_init.f90
+
+libgfortran_nonshared80_la_SOURCES = \
+$(nonshared_runtime_C_SRC) \
+$(nonshared_generated_C_SRC) \
+$(nonshared_intrinsics_C_SRC) \
+$(nonshared_intrinsics_f90_SRC) \
+$(srcdir)/ieee/nonshared-ieee_arithmetic.c \
+$(srcdir)/ieee/nonshared-ieee_exceptions.c \
+$(srcdir)/io/nonshared-transfer.c \
+$(srcdir)/runtime/nonshared-error.c
+
+libgfortran_nonshared110_la_SOURCES = \
+$(srcdir)/ieee/nonshared-ieee_exceptions.c
+
I_M4_DEPS=m4/iparm.m4 m4/mtype.m4
I_M4_DEPS0=$(I_M4_DEPS) m4/iforeach.m4
I_M4_DEPS1=$(I_M4_DEPS) m4/ifunction.m4
--- libgfortran/ieee/nonshared-ieee_exceptions.c.jj 2024-07-19 16:22:00.655418401 +0200
+++ libgfortran/ieee/nonshared-ieee_exceptions.c 2024-07-19 16:22:00.655418401 +0200
@@ -0,0 +1,50 @@
+/* Helper functions in C for IEEE modules
+ Copyright (C) 2013-2023 Free Software Foundation, Inc.
+ Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran 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.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#include "libgfortran.h"
+
+#define options ((const options_t) {})
+
+#include "fpu-target.h"
+
+struct ieee_modes_type {
+ GFC_INTEGER_4 rounding, underflow, halting;
+};
+
+void
+__ieee_exceptions_MOD_ieee_get_modes (struct ieee_modes_type *modes)
+{
+ modes->rounding = get_fpu_rounding_mode ();
+ modes->underflow = get_fpu_underflow_mode ();
+ modes->halting = get_fpu_trap_exceptions ();
+}
+
+void
+__ieee_exceptions_MOD_ieee_set_modes (struct ieee_modes_type *modes)
+{
+ set_fpu_rounding_mode (modes->rounding);
+ set_fpu_underflow_mode (modes->underflow);
+ set_fpu_trap_exceptions (modes->halting, ~modes->halting);
+}
--- libgfortran/ieee/nonshared-ieee_arithmetic.c.jj 2024-07-19 16:22:00.655418401 +0200
+++ libgfortran/ieee/nonshared-ieee_arithmetic.c 2024-07-19 16:22:00.655418401 +0200
@@ -0,0 +1,64 @@
+/* Helper functions in C for IEEE modules
+ Copyright (C) 2013-2023 Free Software Foundation, Inc.
+ Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran 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.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#include "libgfortran.h"
+
+GFC_LOGICAL_4
+__ieee_arithmetic_MOD_ieee_support_subnormal_4 (gfc_array_r4 *arg)
+{
+ (void) arg;
+ return 1;
+}
+
+GFC_LOGICAL_4
+__ieee_arithmetic_MOD_ieee_support_subnormal_8 (gfc_array_r8 *arg)
+{
+ (void) arg;
+ return 1;
+}
+
+#ifdef HAVE_GFC_REAL_10
+GFC_LOGICAL_4
+__ieee_arithmetic_MOD_ieee_support_subnormal_10 (gfc_array_r10 *arg)
+{
+ (void) arg;
+ return 1;
+}
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+GFC_LOGICAL_4
+__ieee_arithmetic_MOD_ieee_support_subnormal_16 (gfc_array_r16 *arg)
+{
+ (void) arg;
+ return 1;
+}
+#endif
+
+GFC_LOGICAL_4
+__ieee_arithmetic_MOD_ieee_support_subnormal_noarg (void)
+{
+ return 1;
+}
--- libgfortran/Makefile.in.jj 2024-04-26 11:47:02.744161886 +0200
+++ libgfortran/Makefile.in 2024-07-19 16:22:46.496837520 +0200
@@ -216,7 +216,8 @@ am__uninstall_files_from_dir = { \
am__installdirs = "$(DESTDIR)$(cafexeclibdir)" \
"$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" \
"$(DESTDIR)$(gfor_cdir)" "$(DESTDIR)$(fincludedir)"
-LTLIBRARIES = $(cafexeclib_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
+LTLIBRARIES = $(cafexeclib_LTLIBRARIES) $(noinst_LTLIBRARIES) \
+ $(toolexeclib_LTLIBRARIES)
libcaf_single_la_LIBADD =
am_libcaf_single_la_OBJECTS = single.lo
libcaf_single_la_OBJECTS = $(am_libcaf_single_la_OBJECTS)
@@ -484,6 +485,40 @@ am_libgfortran_la_OBJECTS = $(am__object
$(am__objects_55) $(am__objects_58) $(am__objects_59) \
$(am__objects_60) $(am__objects_64)
libgfortran_la_OBJECTS = $(am_libgfortran_la_OBJECTS)
+libgfortran_nonshared110_la_LIBADD =
+am_libgfortran_nonshared110_la_OBJECTS = nonshared-ieee_exceptions.lo
+libgfortran_nonshared110_la_OBJECTS = \
+ $(am_libgfortran_nonshared110_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+libgfortran_nonshared80_la_LIBADD =
+am__objects_65 = nonshared-ISO_Fortran_binding.lo
+am__objects_66 = nonshared-findloc0_i1.lo nonshared-findloc0_i2.lo \
+ nonshared-findloc0_i4.lo nonshared-findloc0_i8.lo \
+ nonshared-findloc0_i16.lo nonshared-findloc0_r4.lo \
+ nonshared-findloc0_r8.lo nonshared-findloc0_r10.lo \
+ nonshared-findloc0_r16.lo nonshared-findloc0_c4.lo \
+ nonshared-findloc0_c8.lo nonshared-findloc0_c10.lo \
+ nonshared-findloc0_c16.lo nonshared-findloc0_s1.lo \
+ nonshared-findloc0_s4.lo nonshared-findloc1_i1.lo \
+ nonshared-findloc1_i2.lo nonshared-findloc1_i4.lo \
+ nonshared-findloc1_i8.lo nonshared-findloc1_i16.lo \
+ nonshared-findloc1_r4.lo nonshared-findloc1_r8.lo \
+ nonshared-findloc1_r10.lo nonshared-findloc1_r16.lo \
+ nonshared-findloc1_c4.lo nonshared-findloc1_c8.lo \
+ nonshared-findloc1_c10.lo nonshared-findloc1_c16.lo \
+ nonshared-findloc1_s1.lo nonshared-findloc1_s4.lo \
+ nonshared-findloc2_s1.lo nonshared-findloc2_s4.lo
+am__objects_67 = nonshared-is_contiguous.lo nonshared-trigd.lo
+am__objects_68 = nonshared-random_init.lo
+am_libgfortran_nonshared80_la_OBJECTS = $(am__objects_65) \
+ $(am__objects_66) $(am__objects_67) $(am__objects_68) \
+ nonshared-ieee_arithmetic.lo nonshared-ieee_exceptions.lo \
+ nonshared-transfer.lo nonshared-error.lo
+libgfortran_nonshared80_la_OBJECTS = \
+ $(am_libgfortran_nonshared80_la_OBJECTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -500,10 +535,6 @@ DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/../depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \
@@ -547,7 +578,9 @@ AM_V_FC = $(am__v_FC_@AM_V@)
am__v_FC_ = $(am__v_FC_@AM_DEFAULT_V@)
am__v_FC_0 = @echo " FC " $@;
am__v_FC_1 =
-SOURCES = $(libcaf_single_la_SOURCES) $(libgfortran_la_SOURCES)
+SOURCES = $(libcaf_single_la_SOURCES) $(libgfortran_la_SOURCES) \
+ $(libgfortran_nonshared110_la_SOURCES) \
+ $(libgfortran_nonshared80_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -753,6 +786,7 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdi
$(lt_host_flags)
toolexeclib_LTLIBRARIES = libgfortran.la
+noinst_LTLIBRARIES = libgfortran_nonshared80.la libgfortran_nonshared110.la
toolexeclib_DATA = libgfortran.spec
libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
@@ -1655,6 +1689,66 @@ BUILT_SOURCES = $(gfor_built_src) $(gfor
libgfortran_la_SOURCES = $(gfor_src) $(gfor_built_src) $(gfor_io_src) \
$(gfor_helper_src) $(gfor_ieee_src) $(gfor_io_headers) $(gfor_specific_src)
+nonshared_runtime_C_SRC = \
+nonshared-ISO_Fortran_binding.c
+
+nonshared_io_C_SRC = \
+$(srcdir)/io/nonshared-transfer.c
+
+nonshared_generated_C_SRC = \
+nonshared-findloc0_i1.c \
+nonshared-findloc0_i2.c \
+nonshared-findloc0_i4.c \
+nonshared-findloc0_i8.c \
+nonshared-findloc0_i16.c \
+nonshared-findloc0_r4.c \
+nonshared-findloc0_r8.c \
+nonshared-findloc0_r10.c \
+nonshared-findloc0_r16.c \
+nonshared-findloc0_c4.c \
+nonshared-findloc0_c8.c \
+nonshared-findloc0_c10.c \
+nonshared-findloc0_c16.c \
+nonshared-findloc0_s1.c \
+nonshared-findloc0_s4.c \
+nonshared-findloc1_i1.c \
+nonshared-findloc1_i2.c \
+nonshared-findloc1_i4.c \
+nonshared-findloc1_i8.c \
+nonshared-findloc1_i16.c \
+nonshared-findloc1_r4.c \
+nonshared-findloc1_r8.c \
+nonshared-findloc1_r10.c \
+nonshared-findloc1_r16.c \
+nonshared-findloc1_c4.c \
+nonshared-findloc1_c8.c \
+nonshared-findloc1_c10.c \
+nonshared-findloc1_c16.c \
+nonshared-findloc1_s1.c \
+nonshared-findloc1_s4.c \
+nonshared-findloc2_s1.c \
+nonshared-findloc2_s4.c
+
+nonshared_intrinsics_C_SRC = \
+nonshared-is_contiguous.c \
+nonshared-trigd.c
+
+nonshared_intrinsics_f90_SRC = \
+nonshared-random_init.f90
+
+libgfortran_nonshared80_la_SOURCES = \
+$(nonshared_runtime_C_SRC) \
+$(nonshared_generated_C_SRC) \
+$(nonshared_intrinsics_C_SRC) \
+$(nonshared_intrinsics_f90_SRC) \
+$(srcdir)/ieee/nonshared-ieee_arithmetic.c \
+$(srcdir)/ieee/nonshared-ieee_exceptions.c \
+$(srcdir)/io/nonshared-transfer.c \
+$(srcdir)/runtime/nonshared-error.c
+
+libgfortran_nonshared110_la_SOURCES = \
+$(srcdir)/ieee/nonshared-ieee_exceptions.c
+
I_M4_DEPS = m4/iparm.m4 m4/mtype.m4
I_M4_DEPS0 = $(I_M4_DEPS) m4/iforeach.m4
I_M4_DEPS1 = $(I_M4_DEPS) m4/ifunction.m4
@@ -1765,6 +1859,17 @@ clean-cafexeclibLTLIBRARIES:
rm -f $${locs}; \
}
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
@@ -1806,6 +1911,12 @@ libcaf_single.la: $(libcaf_single_la_OBJ
libgfortran.la: $(libgfortran_la_OBJECTS) $(libgfortran_la_DEPENDENCIES) $(EXTRA_libgfortran_la_DEPENDENCIES)
$(AM_V_GEN)$(libgfortran_la_LINK) -rpath $(toolexeclibdir) $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD) $(LIBS)
+libgfortran_nonshared110.la: $(libgfortran_nonshared110_la_OBJECTS) $(libgfortran_nonshared110_la_DEPENDENCIES) $(EXTRA_libgfortran_nonshared110_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(libgfortran_nonshared110_la_OBJECTS) $(libgfortran_nonshared110_la_LIBADD) $(LIBS)
+
+libgfortran_nonshared80.la: $(libgfortran_nonshared80_la_OBJECTS) $(libgfortran_nonshared80_la_DEPENDENCIES) $(EXTRA_libgfortran_nonshared80_la_DEPENDENCIES)
+ $(AM_V_FCLD)$(FCLINK) $(libgfortran_nonshared80_la_OBJECTS) $(libgfortran_nonshared80_la_LIBADD) $(LIBS)
+
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -2256,6 +2367,45 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minval_r8.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_alloc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mvbits.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-ISO_Fortran_binding.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-error.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_s1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc0_s4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_r8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_s1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc1_s4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc2_s1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-findloc2_s4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-ieee_arithmetic.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-ieee_exceptions.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-is_contiguous.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-transfer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonshared-trigd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r10.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r16.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm2_r17.Plo@am__quote@
@@ -7300,6 +7450,34 @@ ieee_helper.lo: ieee/ieee_helper.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ieee_helper.lo `test -f 'ieee/ieee_helper.c' || echo '$(srcdir)/'`ieee/ieee_helper.c
+nonshared-ieee_exceptions.lo: $(srcdir)/ieee/nonshared-ieee_exceptions.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nonshared-ieee_exceptions.lo -MD -MP -MF $(DEPDIR)/nonshared-ieee_exceptions.Tpo -c -o nonshared-ieee_exceptions.lo `test -f '$(srcdir)/ieee/nonshared-ieee_exceptions.c' || echo '$(srcdir)/'`$(srcdir)/ieee/nonshared-ieee_exceptions.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nonshared-ieee_exceptions.Tpo $(DEPDIR)/nonshared-ieee_exceptions.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/ieee/nonshared-ieee_exceptions.c' object='nonshared-ieee_exceptions.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nonshared-ieee_exceptions.lo `test -f '$(srcdir)/ieee/nonshared-ieee_exceptions.c' || echo '$(srcdir)/'`$(srcdir)/ieee/nonshared-ieee_exceptions.c
+
+nonshared-ieee_arithmetic.lo: $(srcdir)/ieee/nonshared-ieee_arithmetic.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nonshared-ieee_arithmetic.lo -MD -MP -MF $(DEPDIR)/nonshared-ieee_arithmetic.Tpo -c -o nonshared-ieee_arithmetic.lo `test -f '$(srcdir)/ieee/nonshared-ieee_arithmetic.c' || echo '$(srcdir)/'`$(srcdir)/ieee/nonshared-ieee_arithmetic.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nonshared-ieee_arithmetic.Tpo $(DEPDIR)/nonshared-ieee_arithmetic.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/ieee/nonshared-ieee_arithmetic.c' object='nonshared-ieee_arithmetic.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nonshared-ieee_arithmetic.lo `test -f '$(srcdir)/ieee/nonshared-ieee_arithmetic.c' || echo '$(srcdir)/'`$(srcdir)/ieee/nonshared-ieee_arithmetic.c
+
+nonshared-transfer.lo: $(srcdir)/io/nonshared-transfer.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nonshared-transfer.lo -MD -MP -MF $(DEPDIR)/nonshared-transfer.Tpo -c -o nonshared-transfer.lo `test -f '$(srcdir)/io/nonshared-transfer.c' || echo '$(srcdir)/'`$(srcdir)/io/nonshared-transfer.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nonshared-transfer.Tpo $(DEPDIR)/nonshared-transfer.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/io/nonshared-transfer.c' object='nonshared-transfer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nonshared-transfer.lo `test -f '$(srcdir)/io/nonshared-transfer.c' || echo '$(srcdir)/'`$(srcdir)/io/nonshared-transfer.c
+
+nonshared-error.lo: $(srcdir)/runtime/nonshared-error.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nonshared-error.lo -MD -MP -MF $(DEPDIR)/nonshared-error.Tpo -c -o nonshared-error.lo `test -f '$(srcdir)/runtime/nonshared-error.c' || echo '$(srcdir)/'`$(srcdir)/runtime/nonshared-error.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nonshared-error.Tpo $(DEPDIR)/nonshared-error.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/runtime/nonshared-error.c' object='nonshared-error.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nonshared-error.lo `test -f '$(srcdir)/runtime/nonshared-error.c' || echo '$(srcdir)/'`$(srcdir)/runtime/nonshared-error.c
+
.f90.o:
$(AM_V_FC)$(FCCOMPILE) -c -o $@ $<
@@ -7494,7 +7672,8 @@ maintainer-clean-generic:
clean: clean-am
clean-am: clean-cafexeclibLTLIBRARIES clean-generic clean-libtool \
- clean-local clean-toolexeclibLTLIBRARIES mostlyclean-am
+ clean-local clean-noinstLTLIBRARIES \
+ clean-toolexeclibLTLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
@@ -7574,14 +7753,15 @@ uninstall-am: uninstall-cafexeclibLTLIBR
.PHONY: CTAGS GTAGS TAGS all all-am all-local am--refresh check \
check-am clean clean-cafexeclibLTLIBRARIES clean-cscope \
clean-generic clean-libtool clean-local \
- clean-toolexeclibLTLIBRARIES cscope cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-hdr distclean-libtool distclean-local distclean-tags \
- dvi dvi-am html html-am info info-am install install-am \
- install-cafexeclibLTLIBRARIES install-data install-data-am \
- install-dvi install-dvi-am install-exec install-exec-am \
- install-exec-local install-gfor_cHEADERS install-html \
- install-html-am install-info install-info-am install-man \
+ clean-noinstLTLIBRARIES clean-toolexeclibLTLIBRARIES cscope \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-local distclean-tags dvi dvi-am html html-am info \
+ info-am install install-am install-cafexeclibLTLIBRARIES \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-exec-local \
+ install-gfor_cHEADERS install-html install-html-am \
+ install-info install-info-am install-man \
install-nodist_fincludeHEADERS install-pdf install-pdf-am \
install-ps install-ps-am install-strip install-toolexeclibDATA \
install-toolexeclibLTLIBRARIES installcheck installcheck-am \
@@ -7649,6 +7829,38 @@ ieee_exceptions.mod: ieee_exceptions.lo
ieee_arithmetic.mod: ieee_arithmetic.lo
:
+$(patsubst %.c,%.lo,$(nonshared_generated_C_SRC) $(nonshared)): \
+nonshared-%.lo: $(srcdir)/generated/%.c
+ $(LTCOMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.c,%.o,$(nonshared_generated_C_SRC) $(nonshared)): \
+nonshared-%.o: $(srcdir)/generated/%.c
+ $(COMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.c,%.lo,$(nonshared_intrinsics_C_SRC) $(nonshared)): \
+nonshared-%.lo: $(srcdir)/intrinsics/%.c
+ $(LTCOMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.c,%.o,$(nonshared_intrinsics_C_SRC) $(nonshared)): \
+nonshared-%.o: $(srcdir)/intrinsics/%.c
+ $(COMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.c,%.lo,$(nonshared_runtime_C_SRC) $(nonshared)): \
+nonshared-%.lo: $(srcdir)/runtime/%.c
+ $(LTCOMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.c,%.o,$(nonshared_runtime_C_SRC) $(nonshared)): \
+nonshared-%.o: $(srcdir)/runtime/%.c
+ $(COMPILE) -c -o $@ $< -DLIBGFORTRAN_NONSHARED
+
+$(patsubst %.f90,%.lo,$(nonshared_intrinsics_f90_SRC) $(nonshared)): \
+nonshared-%.lo: $(srcdir)/intrinsics/%.f90
+ $(LTPPFCCOMPILE) -c -o $@ $< -fallow-leading-underscore
+
+$(patsubst %.f90,%.o,$(nonshared_intrinsics_f90_SRC) $(nonshared)): \
+nonshared-%.o: $(srcdir)/intrinsics/%.f90
+ $(PPFCCOMPILE) -c -o $@ $< -fallow-leading-underscore
+
kinds.h: $(srcdir)/mk-kinds-h.sh
$(SHELL) $(srcdir)/mk-kinds-h.sh '@LIBGOMP_CHECKED_INT_KINDS@' \
'@LIBGOMP_CHECKED_REAL_KINDS@' \
--- libgfortran/libgfortran.h.jj 2024-04-26 11:47:02.891159849 +0200
+++ libgfortran/libgfortran.h 2024-07-19 16:22:00.666418262 +0200
@@ -216,7 +216,7 @@ extern int __mingw_snprintf (char *, siz
# define internal_proto(x) sym_rename(x, IPREFIX(x))
#endif
-#if defined(HAVE_ATTRIBUTE_VISIBILITY) && defined(HAVE_ATTRIBUTE_ALIAS)
+#if defined(HAVE_ATTRIBUTE_VISIBILITY) && defined(HAVE_ATTRIBUTE_ALIAS) && !defined(LIBGFORTRAN_NONSHARED)
# define export_proto(x) sym_rename(x, PREFIX(x))
# define export_proto_np(x) extern char swallow_semicolon
# define iexport_proto(x) internal_proto(x)
@@ -291,6 +291,10 @@ typedef GFC_UINTEGER_4 gfc_char4_t;
simply equal to the kind parameter itself. */
#define GFC_SIZE_OF_CHAR_KIND(kind) (kind)
+#ifdef LIBGFORTRAN_NONSHARED
+#define big_endian (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
+#endif
+
#define GFOR_POINTER_TO_L1(p, kind) \
((__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ? 1: 0) * (kind - 1) + (GFC_LOGICAL_1 *)(p))
@@ -2024,4 +2028,63 @@ extern int __snprintfieee128 (char *, si
#define HAVE_GFC_UINTEGER_1 1
#define HAVE_GFC_UINTEGER_4 1
+#ifdef LIBGFORTRAN_NONSHARED
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#define internal_malloc_size nonshared_internal_malloc_size
+#define xmalloc nonshared_internal_xmalloc
+#define xmallocarray nonshared_internal_xmallocarray
+#define reshape_packed nonshared_reshape_packed
+static inline __attribute__((__always_inline__, __unused__))
+void *
+internal_malloc_size (size_t size)
+{
+ void *p;
+
+ if (size == 0)
+ return NULL;
+
+ p = (void *) malloc (size);
+ if (p == NULL)
+ os_error ("Memory allocation failed");
+ return p;
+}
+
+static inline __attribute__((__always_inline__, __unused__))
+void *
+xmalloc (size_t size)
+{
+ return internal_malloc_size (size ? size : 1);
+}
+
+static inline __attribute__((__always_inline__, __unused__))
+void *
+xmallocarray (size_t nmemb, size_t size)
+{
+ if (!nmemb || !size)
+ size = nmemb = 1;
+ else if (__builtin_expect ((nmemb | size)
+ >= (((size_t) 1) << (__CHAR_BIT__
+ * sizeof (size_t) / 2)), 0)
+ && nmemb > __SIZE_MAX__ / size)
+ {
+ errno = ENOMEM;
+ os_error ("Integer overflow in xmallocarray");
+ }
+
+ return internal_malloc_size (nmemb * size);
+}
+
+static inline __attribute__((__always_inline__, __unused__))
+#include "intrinsics/reshape_packed.c"
+
+struct no_bounds_check { int bounds_check; };
+#define compile_options ((struct no_bounds_check) { .bounds_check = 0 })
+
+#define internal_error(x, y...) runtime_error (y)
+
+#endif
+
#endif /* LIBGFOR_H */
--- libgfortran/runtime/nonshared-error.c.jj 2024-07-19 16:22:00.666418262 +0200
+++ libgfortran/runtime/nonshared-error.c 2024-07-19 16:22:00.666418262 +0200
@@ -0,0 +1,56 @@
+/* Copyright (C) 2020-2023 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran 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.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+
+#define LIBGFORTRAN_NONSHARED
+#include "libgfortran.h"
+#include "io.h"
+#include "async.h"
+
+#include <string.h>
+#include <stdio.h>
+
+/* Improved version of os_error with a printf style format string and
+ a locus. */
+
+void
+os_error_at (const char *where, const char *message, ...)
+{
+ char buf[4096];
+ size_t len = strlen (where);
+ int written;
+ va_list ap;
+
+ if (len >= 2048)
+ os_error ("Unknown error");
+ memcpy (buf, where, len);
+ memcpy (buf + len, ": ", 2);
+ va_start (ap, message);
+ written = vsnprintf (buf + len + 2, 4095 - len - 2, message, ap);
+ va_end (ap);
+ if (written < 0)
+ written = 0;
+ buf[len + 2 + written] = '\0';
+ os_error (buf);
+}
+iexport(os_error_at);
--- libgfortran/io/nonshared-transfer.c.jj 2024-07-19 16:22:00.666418262 +0200
+++ libgfortran/io/nonshared-transfer.c 2024-07-19 16:22:00.666418262 +0200
@@ -0,0 +1,42 @@
+/* Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ Contributed by Andy Vaught
+ Namelist transfer functions contributed by Paul Thomas
+ F2003 I/O support contributed by Jerry DeLisle
+
+This file is part of the GNU Fortran runtime library (libgfortran).
+
+Libgfortran 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.
+
+Libgfortran 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+
+/* transfer.c -- Top level handling of data transfer statements. */
+
+#include "io.h"
+#include "fbuf.h"
+#include "format.h"
+#include "unix.h"
+#include "async.h"
+#include <string.h>
+#include <errno.h>
+
+void
+st_wait_async (st_parameter_wait *wtp)
+{
+ (void) wtp;
+}

View File

@ -0,0 +1,17 @@
2008-06-09 Jakub Jelinek <jakub@redhat.com>
* omp.h.in (omp_nest_lock_t): Fix up for Linux multilibs.
--- libgomp/omp.h.in.jj 2008-06-09 13:34:05.000000000 +0200
+++ libgomp/omp.h.in 2008-06-09 13:34:48.000000000 +0200
@@ -42,8 +42,8 @@ typedef struct
typedef struct
{
- unsigned char _x[@OMP_NEST_LOCK_SIZE@]
- __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@)));
+ unsigned char _x[8 + sizeof (void *)]
+ __attribute__((__aligned__(sizeof (void *))));
} omp_nest_lock_t;
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
--- libstdc++-v3/doc/html/index.html.jj 2011-01-03 12:53:21.282829010 +0100
+++ libstdc++-v3/doc/html/index.html 2011-01-04 18:06:28.999851145 +0100
@@ -5,6 +5,8 @@
<a class="link" href="https://www.fsf.org" target="_top">FSF
</a>
</p><p>
+ Release 14.1.1
+ </p><p>
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation
License, Version 1.2 or any later version published by the
--- libstdc++-v3/doc/html/api.html.jj 2011-01-03 12:53:21.000000000 +0100
+++ libstdc++-v3/doc/html/api.html 2011-01-04 18:12:01.672757784 +0100
@@ -20,7 +20,9 @@
member functions for the library classes, finding out what is in a
particular include file, looking at inheritance diagrams, etc.
</p><p>
- The API documentation, rendered into HTML, can be viewed online
+ The API documentation, rendered into HTML, can be viewed locally
+ <a class="link" href="api/index.html" target="_top">for the 14.1.1 release</a>,
+ online
<a class="link" href="http://gcc.gnu.org/onlinedocs/" target="_top">for each GCC release</a>
and
<a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/index.html" target="_top">

View File

@ -0,0 +1,27 @@
libtool sucks.
--- ltmain.sh.jj 2007-12-07 14:53:21.000000000 +0100
+++ ltmain.sh 2008-09-05 21:51:48.000000000 +0200
@@ -5394,6 +5394,7 @@ EOF
rpath="$finalize_rpath"
test "$mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64|/usr/lib/../lib64/lp64d) continue;; esac
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
@@ -6071,6 +6072,7 @@ EOF
rpath=
hardcode_libdirs=
for libdir in $compile_rpath $finalize_rpath; do
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64|/usr/lib/../lib64/lp64d) continue;; esac
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
@@ -6120,6 +6122,7 @@ EOF
rpath=
hardcode_libdirs=
for libdir in $finalize_rpath; do
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64|/usr/lib/../lib64/lp64d) continue;; esac
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then

View File

@ -0,0 +1,37 @@
2010-02-08 Roland McGrath <roland@redhat.com>
* config/gnu-user.h (LINK_EH_SPEC): Pass --no-add-needed to the linker.
* config/alpha/elf.h (LINK_EH_SPEC): Likewise.
* config/ia64/linux.h (LINK_EH_SPEC): Likewise.
--- gcc/config/alpha/elf.h.jj 2011-01-03 12:52:31.118056764 +0100
+++ gcc/config/alpha/elf.h 2011-01-04 18:14:10.931874160 +0100
@@ -168,5 +168,5 @@ extern int alpha_this_gpdisp_sequence_nu
I imagine that other systems will catch up. In the meantime, it
doesn't harm to make sure that the data exists to be used later. */
#if defined(HAVE_LD_EH_FRAME_HDR)
-#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
+#define LINK_EH_SPEC "--no-add-needed %{!static|static-pie:--eh-frame-hdr} "
#endif
--- gcc/config/ia64/linux.h.jj 2011-01-03 13:02:11.462994522 +0100
+++ gcc/config/ia64/linux.h 2011-01-04 18:14:10.931874160 +0100
@@ -76,7 +76,7 @@ do { \
Signalize that because we have fde-glibc, we don't need all C shared libs
linked against -lgcc_s. */
#undef LINK_EH_SPEC
-#define LINK_EH_SPEC ""
+#define LINK_EH_SPEC "--no-add-needed "
#undef TARGET_INIT_LIBFUNCS
#define TARGET_INIT_LIBFUNCS ia64_soft_fp_init_libfuncs
--- gcc/config/gnu-user.h.jj 2011-01-03 12:53:03.739057299 +0100
+++ gcc/config/gnu-user.h 2011-01-04 18:14:10.932814884 +0100
@@ -106,7 +106,7 @@ see the files COPYING3 and COPYING.RUNTI
#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
#if defined(HAVE_LD_EH_FRAME_HDR)
-#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
+#define LINK_EH_SPEC "--no-add-needed %{!static|static-pie:--eh-frame-hdr} "
#endif
#define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \

View File

@ -0,0 +1,76 @@
Based on Richi's patch:
<https://gcc.gnu.org/pipermail/gcc-patches/2024-April/648725.html>
~~
The following avoids re-walking and re-combining the instructions
between i2 and i3 when the pattern of i2 doesn't change.
Bootstrap and regtest running ontop of a reversal of
r14-9692-g839bc42772ba7a.
It brings down memory use from 9GB to 400MB and compile-time from
80s to 3.5s. r14-9692-g839bc42772ba7a does better in both metrics
but has shown code generation regressions across architectures.
PR rtl-optimization/101523
* combine.cc (try_combine): When the pattern of i2 doesn't
change do not re-start combining at i2 or an earlier insn which
had links or notes added.
~~
But, since the patch affects code generation (for instance,
libstdc++-v3/src/c++17/floating_from_chars.o), we limit the bailing out
only when I2 hasn't been changed 1000x. I've measured how many times
at most is I2 unchanged during a bootstrap + regtest.
x86: 134
aarch64: 736 (gimple-match-1.cc)
s390x: 635 (gimple-match-*)
ppc64le: 620 (gimple-match-*)
while certain pathological testcases trigger it more than 10,000 times.
With the limit in place this patch doesn't affect common code.
--- a/gcc/combine.cc
+++ b/gcc/combine.cc
@@ -92,6 +92,11 @@ along with GCC; see the file COPYING3. If not see
#include "function-abi.h"
#include "rtlanal.h"
+/* Number of times I2 didn't change in try_combine. Used to prevent a
+ combinatorial explosion. */
+
+static int combine_i2_unchanged;
+
/* Number of attempts to combine instructions in this function. */
static int combine_attempts;
@@ -1127,6 +1132,7 @@ combine_instructions (rtx_insn *f, unsigned int nregs)
return false;
combine_attempts = 0;
+ combine_i2_unchanged = 0;
combine_merges = 0;
combine_extras = 0;
combine_successes = 0;
@@ -4196,6 +4201,10 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
adjust_for_new_dest (i3);
}
+ bool i2_i2_unchanged = false;
+ if (rtx_equal_p (newi2pat, PATTERN (i2)))
+ i2_i2_unchanged = true;
+
/* We now know that we can do this combination. Merge the insns and
update the status of registers and LOG_LINKS. */
@@ -4762,6 +4771,13 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
combine_successes++;
undo_commit ();
+ if (i2_i2_unchanged)
+ {
+ if (combine_i2_unchanged == 1000)
+ return i3;
+ ++combine_i2_unchanged;
+ }
+
rtx_insn *ret = newi2pat ? i2 : i3;
if (added_links_insn && DF_INSN_LUID (added_links_insn) < DF_INSN_LUID (ret))
ret = added_links_insn;

View File

@ -0,0 +1,21 @@
crt files and statically linked libgcc objects cause false positives
in annobin coverage, so we add the assembler flag to generate notes
for them.
The patch also adds notes to libgcc_s.so, but this is harmless because
these notes only confer that there is no other annobin markup.
2018-07-25 Florian Weimer <fweimer@redhat.com>
* config/t-linux (LIBGCC2_CFLAGS, CRTSTUFF_CFLAGS): Add
-Wa,--generate-missing-build-notes=yes.
--- libgcc/config/t-linux 2022-12-15 19:25:20.581394950 +0100
+++ libgcc/config/t-linux 2023-03-21 22:00:37.054478562 +0100
@@ -1,3 +1,6 @@
# Override t-slibgcc-elf-ver to export some libgcc symbols with
# the symbol versions that glibc used.
SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
+
+LIBGCC2_CFLAGS += -Wa,--generate-missing-build-notes=yes
+CRTSTUFF_CFLAGS += -Wa,--generate-missing-build-notes=yes

View File

@ -0,0 +1,40 @@
--- gcc/config.gcc.jj 2008-04-24 15:42:46.000000000 -0500
+++ gcc/config.gcc 2008-04-24 15:44:51.000000000 -0500
@@ -3330,7 +3330,7 @@ sparc-*-rtems*)
tm_file="${tm_file} elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems"
;;
-sparc-*-linux*)
+sparc-*-linux* | sparcv9-*-linux*)
tm_file="${tm_file} elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h"
extra_options="${extra_options} sparc/long-double-switch.opt"
case ${target} in
@@ -3384,7 +3384,7 @@ sparc64-*-rtems*)
extra_options="${extra_options}"
tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64"
;;
-sparc64-*-linux*)
+sparc64*-*-linux*)
tm_file="sparc/biarch64.h ${tm_file} elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default64.h sparc/linux64.h sparc/tso.h"
extra_options="${extra_options} sparc/long-double-switch.opt"
tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
--- libgcc/config.host.jj 2008-04-24 15:46:19.000000000 -0500
+++ libgcc/config.host 2008-04-24 15:46:49.000000000 -0500
@@ -1002,7 +1002,7 @@ sparc-*-elf*)
tmake_file="${tmake_file} t-fdpbit t-crtfm"
extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
;;
-sparc-*-linux*) # SPARC's running GNU/Linux, libc6
+sparc-*-linux* | sparcv9-*-linux*) # SPARC's running GNU/Linux, libc6
tmake_file="${tmake_file} t-crtfm"
if test "${host_address}" = 64; then
tmake_file="$tmake_file sparc/t-linux64"
@@ -1050,7 +1050,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*
tmake_file="$tmake_file t-crtfm"
extra_parts="$extra_parts crtfastmath.o"
;;
-sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
+sparc64*-*-linux*) # 64-bit SPARC's running GNU/Linux
extra_parts="$extra_parts crtfastmath.o"
tmake_file="${tmake_file} t-crtfm sparc/t-linux"
if test "${host_address}" = 64; then

View File

@ -0,0 +1,85 @@
From: Sven Verdoolaege <sven.verdoolaege@gmail.com>
Date: Mon, 6 Jun 2022 12:56:02 +0000 (+0200)
Subject: update m4/ax_prog_cc_for_build.m4
X-Git-Tag: isl-0.25~11
X-Git-Url: https://repo.or.cz/isl.git/commitdiff_plain/b4dcdfadc29a6c9f410a72f345f3f32725b1d38b
update m4/ax_prog_cc_for_build.m4
In particular, update to the latest version from the autoconf archive,
but preserve the changes from isl-0.22.1-358-gcd42abdf2
(m4/ax_prog_cc_for_build.m4: do not override host compiler dependency style,
Tue Jun 9 10:54:10 2020 +0200).
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
--- isl-0.24/m4/ax_prog_cc_for_build.m4.jj 2021-03-02 12:07:09.000000000 +0100
+++ isl-0.24/m4/ax_prog_cc_for_build.m4 2022-12-20 18:11:18.855777817 +0100
@@ -32,7 +32,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 18
+#serial 21
AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
@@ -44,6 +44,8 @@ dnl Use the standard macros, but make th
dnl
pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl
+pushdef([ac_cv_prog_cc_c99], ac_cv_build_prog_cc_c99)dnl
+pushdef([ac_cv_prog_cc_c11], ac_cv_build_prog_cc_c11)dnl
pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
@@ -86,7 +88,21 @@ AS_IF([test -n "$build"], [ac_build
[test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"])
AC_LANG_PUSH([C])
+
+dnl The pushdef([ac_cv_c_compiler_gnu], ...) currently does not cover
+dnl the use of this variable in _AC_LANG_COMPILER_GNU called by
+dnl AC_PROG_CC. Unset this cache variable temporarily as a workaround.
+was_set_c_compiler_gnu=${[ac_cv_c_compiler_gnu]+y}
+AS_IF([test ${was_set_c_compiler_gnu}],
+ [saved_c_compiler_gnu=$[ac_cv_c_compiler_gnu]
+ AS_UNSET([[ac_cv_c_compiler_gnu]])])
+
AC_PROG_CC
+
+dnl Restore ac_cv_c_compiler_gnu
+AS_IF([test ${was_set_c_compiler_gnu}],
+ [[ac_cv_c_compiler_gnu]=$[saved_c_compiler_gnu]])
+
_AC_COMPILER_EXEEXT
_AC_COMPILER_OBJEXT
AC_PROG_CPP
--- isl-0.24/configure.jj 2021-04-26 11:13:19.000000000 +0200
+++ isl-0.24/configure 2022-12-20 18:11:36.882518568 +0100
@@ -5002,6 +4990,13 @@ ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR
ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_build_c_compiler_gnu
+
+was_set_c_compiler_gnu=${ac_cv_c_compiler_gnu+y}
+if test ${was_set_c_compiler_gnu}; then :
+ saved_c_compiler_gnu=$ac_cv_c_compiler_gnu
+ { ac_cv_c_compiler_gnu=; unset ac_cv_c_compiler_gnu;}
+fi
+
ac_ext=c
ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD'
ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5'
@@ -5728,6 +5723,11 @@ else
fi
+
+if test ${was_set_c_compiler_gnu}; then :
+ ac_cv_c_compiler_gnu=$saved_c_compiler_gnu
+fi
+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

View File

@ -0,0 +1,233 @@
# Check distro name is included in the version output.
Patch001: gdb-6.3-rh-testversion-20041202.patch
# Add a wrapper script to GDB that implements pstack using the
# --readnever option.
#=push
Patch002: gdb-6.3-gstack-20050411.patch
# Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
#=push+jan: It should be replaced by Infinity project.
Patch003: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
# Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
#=fedoratest
Patch004: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
# Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
#=fedoratest
Patch005: gdb-6.6-bz229517-gcore-without-terminal.patch
# Avoid too long timeouts on failing cases of "annota1.exp annota3.exp".
#=fedoratest
Patch006: gdb-6.6-testsuite-timeouts.patch
# Support for stepping over PPC atomic instruction sequences (BZ 237572).
#=fedoratest
Patch007: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
# Test kernel VDSO decoding while attaching to an i386 process.
#=fedoratest
Patch008: gdb-6.3-attach-see-vdso-test.patch
# Test leftover zombie process (BZ 243845).
#=fedoratest
Patch009: gdb-6.5-bz243845-stale-testing-zombie-test.patch
# New locating of the matching binaries from the pure core file (build-id).
#=push+jan
Patch010: gdb-6.6-buildid-locate.patch
# Fix loading of core files without build-ids but with build-ids in executables.
# Load strictly build-id-checked core files only if no executable is specified
# (Jan Kratochvil, RH BZ 1339862).
#=push+jan
Patch011: gdb-6.6-buildid-locate-solib-missing-ids.patch
#=push+jan
Patch012: gdb-6.6-buildid-locate-rpm.patch
# Test PPC hiding of call-volatile parameter register.
#=fedoratest
Patch013: gdb-6.7-ppc-clobbered-registers-O2-test.patch
# Test gcore memory and time requirements for large inferiors.
#=fedoratest
Patch014: gdb-6.5-gcore-buffer-limit-test.patch
# Test GCORE for shmid 0 shared memory mappings.
#=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible.
Patch015: gdb-6.3-mapping-zero-inode-test.patch
# Test a crash on libraries missing the .text section.
#=fedoratest
Patch016: gdb-6.5-section-num-fixup-test.patch
# Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
#=fedoratest
Patch017: gdb-6.8-bz466901-backtrace-full-prelinked.patch
# New test for step-resume breakpoint placed in multiple threads at once.
#=fedoratest
Patch018: gdb-simultaneous-step-resume-breakpoint-test.patch
# Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
# Fix regression of undisplayed missing shared libraries caused by a fix for.
#=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*>
Patch019: gdb-core-open-vdso-warning.patch
# Fix follow-exec for C++ programs (bugreported by Martin Stransky).
#=fedoratest
Patch020: gdb-archer-next-over-throw-cxx-exec.patch
# Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
#=push+jan
Patch021: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
# [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604).
#=fedoratest
Patch022: gdb-test-bt-cfi-without-die.patch
# Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
#=fedoratest
Patch023: gdb-bz634108-solib_address.patch
# [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp.
#=fedoratest
Patch024: gdb-test-dw2-aranges.patch
# Workaround PR libc/14166 for inferior calls of strstr.
#=fedoratest: Compatibility with RHELs (unchecked which ones).
Patch025: gdb-glibc-strstr-workaround.patch
# Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343).
#=fedoratest
Patch026: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
# Import regression test for `gdb/findvar.c:417: internal-error:
# read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5.
#=fedoratest
Patch027: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch
# Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614)
#=fedoratest
Patch028: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
# Fix 'gdb gives highly misleading error when debuginfo pkg is present,
# but not corresponding binary pkg' (RH BZ 981154).
#=push+jan
Patch029: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
# Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to
# crash.' (RH BZ 1156192).
#=fedoratest
Patch030: gdb-rhbz1156192-recursive-dlopen-test.patch
# Fix '`catch syscall' doesn't work for parent after `fork' is called'
# (Philippe Waroquiers, RH BZ 1149205).
#=fedoratest
Patch031: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
# Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan
# Kratochvil, RH BZ 1084404).
#=fedoratest
Patch032: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
# Force libncursesw over libncurses to match the includes (RH BZ 1270534).
#=push+jan
Patch033: gdb-fedora-libncursesw.patch
# [aarch64] Fix hardware watchpoints (RH BZ 1261564).
#=fedoratest
Patch034: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
# Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
#=fedora
Patch035: gdb-container-rh-pkg.patch
# [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).
#=fedora
Patch036: gdb-linux_perf-bundle.patch
# Update gdb-add-index.sh such that, when the GDB environment
# variable is not set, the script is smarter than just looking for
# 'gdb' in the $PATH.
#
# The actual search order is now: /usr/bin/gdb.minimal, gdb (in the
# $PATH), then /usr/libexec/gdb.
#
# For the rationale of looking for gdb.minimal see:
#
# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot
#
#=fedora
Patch037: gdb-add-index.patch
# Back-port upstream commit 1f0fab7ff86 as part of a fix for
# non-deterministic gdb-index generation (RH BZ 2232086).
Patch038: gdb-rhbz2232086-refactor-selftest-support.patch
# Back-port upstream commit aa19bc1d259 as part of a fix for
# non-deterministic gdb-index generation (RH BZ 2232086).
Patch039: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch
# Back-port upstream commit acc117b57f7 as part of a fix for
# non-deterministic gdb-index generation (RH BZ 2232086).
Patch040: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch
# Back-port upstream commit aff250145af as part of a fix for
# non-deterministic gdb-index generation (RH BZ 2232086).
Patch041: gdb-rhbz-2232086-generate-gdb-index-consistently.patch
# Back-port upstream commit 3644f41dc80 as part of a fix for
# non-deterministic gdb-index generation (RH BZ 2232086).
Patch042: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch
Patch043: gdb-rhbz2250652-gdbpy_gil.patch
Patch044: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch
Patch045: gdb-ftbs-swapped-calloc-args.patch
# Backport upstream workaround for GCC 14 problem which cause assertion
# failures in GDB.
Patch046: gdb-rhbz2261580-intrusive_list-assertion-fix.patch
# Backport "gdb: s390: Add arch14 record/replay support"
# (Andreas Arnez, RHEL-36225)
Patch047: gdb-rhel-36225-add-arch14-record.patch
# Backport "PowerPC: Add support for Power11 options"
# (Peter Bergner, RHEL-36518)
Patch048: gdb-rhel-36518-add-power11-support.patch
# Update x86 disassembler
Patch049: gdb-rhel-36527-apx-disasm.patch
#Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait"
#(Andrew Burgess, RHEL-13298)
Patch050: gdb-rhel-13298-inferior-funcall-bp-condition-1-of-5.patch
#gdb: fix b/p conditions with infcalls in multi-threaded inferiors
#(Andrew Burgess, RHEL-13298)
Patch051: gdb-rhel-13298-inferior-funcall-bp-condition-2-of-5.patch
#gdb: add timeouts for inferior function calls
#(Andrew Burgess, RHEL-13298)
Patch052: gdb-rhel-13298-inferior-funcall-bp-condition-3-of-5.patch
#gdb: introduce unwind-on-timeout setting
#(Andrew Burgess, RHEL-13298)
Patch053: gdb-rhel-13298-inferior-funcall-bp-condition-4-of-5.patch
#gdb: rename unwindonsignal to unwind-on-signal
#(Andrew Burgess, RHEL-13298)
Patch054: gdb-rhel-13298-inferior-funcall-bp-condition-5-of-5.patch
#gdb/unwinders: better support for $pc not saved
#(Andrew Burgess, RHEL-19390)
Patch055: gdb-rhel-19390-pc-not-saved.patch

View File

@ -0,0 +1,55 @@
%patch -p1 -P001
%patch -p1 -P002
%patch -p1 -P003
%patch -p1 -P004
%patch -p1 -P005
%patch -p1 -P006
%patch -p1 -P007
%patch -p1 -P008
%patch -p1 -P009
%patch -p1 -P010
%patch -p1 -P011
%patch -p1 -P012
%patch -p1 -P013
%patch -p1 -P014
%patch -p1 -P015
%patch -p1 -P016
%patch -p1 -P017
%patch -p1 -P018
%patch -p1 -P019
%patch -p1 -P020
%patch -p1 -P021
%patch -p1 -P022
%patch -p1 -P023
%patch -p1 -P024
%patch -p1 -P025
%patch -p1 -P026
%patch -p1 -P027
%patch -p1 -P028
%patch -p1 -P029
%patch -p1 -P030
%patch -p1 -P031
%patch -p1 -P032
%patch -p1 -P033
%patch -p1 -P034
%patch -p1 -P035
%patch -p1 -P036
%patch -p1 -P037
%patch -p1 -P038
%patch -p1 -P039
%patch -p1 -P040
%patch -p1 -P041
%patch -p1 -P042
%patch -p1 -P043
%patch -p1 -P044
%patch -p1 -P045
%patch -p1 -P046
%patch -p1 -P047
%patch -p1 -P048
%patch -p1 -P049
%patch -p1 -P050
%patch -p1 -P051
%patch -p1 -P052
%patch -p1 -P053
%patch -p1 -P054
%patch -p1 -P055

View File

@ -0,0 +1,120 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-attach-see-vdso-test.patch
;; Test kernel VDSO decoding while attaching to an i386 process.
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.c b/gdb/testsuite/gdb.base/attach-see-vdso.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.c
@@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2007 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <unistd.h>
+
+int main ()
+{
+ pause ();
+ return 1;
+}
diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp
@@ -0,0 +1,77 @@
+# Copyright 2007
+
+# 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+# This test only works on Linux
+if { ![istarget "*-*-linux-gnu*"] } {
+ return 0
+}
+
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+set testfile "attach-see-vdso"
+set srcfile ${testfile}.c
+set binfile [standard_output_file ${testfile}]
+set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]]
+
+# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64).
+#
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } {
+ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+# Start the program running and then wait for a bit, to be sure
+# that it can be attached to.
+
+set testpid [eval exec $binfile &]
+
+# Avoid some race:
+sleep 2
+
+# Start with clean gdb
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+# Never call: gdb_load ${binfile}
+# as the former problem would not reproduce otherwise.
+
+set test "attach"
+gdb_test_multiple "attach $testpid" "$test" {
+ -re "Attaching to process $testpid\r?\n.*$gdb_prompt $" {
+ pass "$test"
+ }
+}
+
+gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO"
+
+# Exit and detach the process.
+
+gdb_exit
+
+# Make sure we don't leave a process around to confuse
+# the next test run (and prevent the compile by keeping
+# the text file busy), in case the "set should_exit" didn't
+# work.
+
+remote_exec build "kill -9 ${testpid}"

View File

@ -0,0 +1,258 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Andrew Cagney <cagney@gnu.org>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-gstack-20050411.patch
;; Add a wrapper script to GDB that implements pstack using the
;; --readnever option.
;;=push
2004-11-23 Andrew Cagney <cagney@redhat.com>
* Makefile.in (uninstall-gstack, install-gstack): New rules, add
to install and uninstall.
* gstack.sh, gstack.1: New files.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2035,7 +2035,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
install: all
@$(MAKE) $(FLAGS_TO_PASS) install-only
-install-only: $(CONFIG_INSTALL)
+install-only: install-gstack $(CONFIG_INSTALL)
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e "$$t"` ; \
if test "x$$transformed_name" = x; then \
@@ -2085,7 +2085,25 @@ install-guile:
install-python:
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
-uninstall: force $(CONFIG_UNINSTALL)
+GSTACK=gstack
+.PHONY: install-gstack
+install-gstack:
+ transformed_name=`t='$(program_transform_name)'; \
+ echo $(GSTACK) | sed -e "$$t"` ; \
+ if test "x$$transformed_name" = x; then \
+ transformed_name=$(GSTACK) ; \
+ else \
+ true ; \
+ fi ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \
+ $(INSTALL_PROGRAM) $(srcdir)/$(GSTACK).sh \
+ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
+ : $(SHELL) $(srcdir)/../mkinstalldirs \
+ $(DESTDIR)$(man1dir) ; \
+ : $(INSTALL_DATA) $(srcdir)/gstack.1 \
+ $(DESTDIR)$(man1dir)/$$transformed_name.1
+
+uninstall: force uninstall-gstack $(CONFIG_UNINSTALL)
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \
@@ -2116,6 +2134,18 @@ uninstall: force $(CONFIG_UNINSTALL)
rm -f $(DESTDIR)$(bindir)/$$transformed_name
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
+.PHONY: uninstall-gstack
+uninstall-gstack:
+ transformed_name=`t='$(program_transform_name)'; \
+ echo $(GSTACK) | sed -e $$t` ; \
+ if test "x$$transformed_name" = x; then \
+ transformed_name=$(GSTACK) ; \
+ else \
+ true ; \
+ fi ; \
+ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
+ $(DESTDIR)$(man1dir)/$$transformed_name.1
+
# The C++ name parser can be built standalone for testing.
test-cp-name-parser.o: cp-name-parser.c
$(COMPILE) -DTEST_CPNAMES cp-name-parser.c
diff --git a/gdb/gstack.sh b/gdb/gstack.sh
new file mode 100644
--- /dev/null
+++ b/gdb/gstack.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+if test $# -ne 1; then
+ echo "Usage: `basename $0 .sh` <process-id>" 1>&2
+ exit 1
+fi
+
+if test ! -r /proc/$1; then
+ echo "Process $1 not found." 1>&2
+ exit 1
+fi
+
+# GDB doesn't allow "thread apply all bt" when the process isn't
+# threaded; need to peek at the process to determine if that or the
+# simpler "bt" should be used.
+
+backtrace="bt"
+if test -d /proc/$1/task ; then
+ # Newer kernel; has a task/ directory.
+ if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
+ backtrace="thread apply all bt"
+ fi
+elif test -f /proc/$1/maps ; then
+ # Older kernel; go by it loading libpthread.
+ if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
+ backtrace="thread apply all bt"
+ fi
+fi
+
+GDB=${GDB:-gdb}
+
+# Run GDB, strip out unwanted noise.
+# --readnever is no longer used since .gdb_index is now in use.
+$GDB --quiet -nx $GDBARGS /proc/$1/exe $1 <<EOF 2>&1 |
+set width 0
+set height 0
+set pagination no
+$backtrace
+EOF
+/bin/sed -n \
+ -e 's/^\((gdb) \)*//' \
+ -e '/^#/p' \
+ -e '/^Thread/p'
diff --git a/gdb/testsuite/gdb.base/gstack.c b/gdb/testsuite/gdb.base/gstack.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gstack.c
@@ -0,0 +1,43 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2005, 2007, 2008, 2009 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, see <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+void
+func (void)
+{
+ const char msg[] = "looping\n";
+
+ /* Use the most simple notification not to get caught by attach on exiting
+ the function. */
+ write (1, msg, strlen (msg));
+
+ for (;;);
+}
+
+int
+main (void)
+{
+ alarm (60);
+ nice (100);
+
+ func ();
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gstack.exp
@@ -0,0 +1,84 @@
+# Copyright (C) 2012 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, see <http://www.gnu.org/licenses/>.
+
+set testfile gstack
+set executable ${testfile}
+set binfile [standard_output_file $executable]
+if {[build_executable ${testfile} ${executable} "" {debug}] == -1} {
+ return -1
+}
+
+set test "spawn inferior"
+set command "${binfile}"
+set res [remote_spawn host $command];
+if { $res < 0 || $res == "" } {
+ perror "Spawning $command failed."
+ fail $test
+ return
+}
+
+# The spawn id of the test inferior.
+set test_spawn_id $res
+
+set use_gdb_stub 1
+set pid [exp_pid -i $res]
+gdb_expect {
+ -re "looping\r\n" {
+ pass $test
+ }
+ eof {
+ fail "$test (eof)"
+ return
+ }
+ timeout {
+ fail "$test (timeout)"
+ return
+ }
+}
+
+# Testcase uses the most simple notification not to get caught by attach on
+# exiting the function. Still we could retry the gstack command if we fail.
+
+set test "spawn gstack"
+set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $BUILD_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END"
+set res [remote_spawn host $command];
+if { $res < 0 || $res == "" } {
+ perror "Spawning $command failed."
+ fail $test
+}
+
+set gdb_spawn_id $res
+
+gdb_test_multiple "" $test {
+ -re "^#0 +(0x\[0-9a-f\]+ in )?\\.?func \\(\\) at \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in \\.?main \\(\\) at \[^\r\n\]*\r\nGSTACK-END\r\n\$" {
+ pass $test
+ }
+}
+
+gdb_test_multiple "" "gstack exits" {
+ eof {
+ set result [wait -i $gdb_spawn_id]
+ verbose $result
+
+ gdb_assert { [lindex $result 2] == 0 } "gstack exits with no error"
+ gdb_assert { [lindex $result 3] == 0 } "gstack's exit status is 0"
+
+ remote_close host
+ clear_gdb_spawn_id
+ }
+}
+
+# Kill the test inferior.
+kill_wait_spawned_process $test_spawn_id

View File

@ -0,0 +1,247 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-mapping-zero-inode-test.patch
;; Test GCORE for shmid 0 shared memory mappings.
;;=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible.
diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.c b/gdb/testsuite/gdb.base/gcore-shmid0.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-shmid0.c
@@ -0,0 +1,128 @@
+/* Copyright 2007, 2009 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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 2 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/*
+ * Test GDB's handling of gcore for mapping with a name but zero inode.
+ */
+
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <assert.h>
+#include <time.h>
+
+/* The same test running in a parallel testsuite may steal us the zero SID,
+ even if we never get any EEXIST. Just try a while. */
+
+#define TIMEOUT_SEC 10
+
+static volatile int v;
+
+static void
+initialized (void)
+{
+ v++;
+}
+
+static void
+unresolved (void)
+{
+ v++;
+}
+
+int
+main (void)
+{
+ int sid;
+ unsigned int *addr = (void *) -1L;
+ int attempt, round = 0;
+ time_t ts_start, ts;
+
+ if (time (&ts_start) == (time_t) -1)
+ {
+ printf ("time (): %m\n");
+ exit (1);
+ }
+
+ /* The generated SID will cycle with an increment of 32768, attempt until it
+ * wraps to 0. */
+
+ for (attempt = 0; addr == (void *) -1L; attempt++)
+ {
+ /* kernel-2.6.25-8.fc9.x86_64 just never returns the value 0 by
+ shmget(2). shmget returns SID range 0..1<<31 in steps of 32768,
+ 0x1000 should be enough but wrap the range it to be sure. */
+
+ if (attempt > 0x21000)
+ {
+ if (time (&ts) == (time_t) -1)
+ {
+ printf ("time (): %m\n");
+ exit (1);
+ }
+
+ if (ts >= ts_start && ts < ts_start + TIMEOUT_SEC)
+ {
+ attempt = 0;
+ round++;
+ continue;
+ }
+
+ printf ("Problem is not reproducible on this kernel (attempt %d, "
+ "round %d)\n", attempt, round);
+ unresolved ();
+ exit (1);
+ }
+
+ sid = shmget ((key_t) rand (), 0x1000, IPC_CREAT | IPC_EXCL | 0777);
+ if (sid == -1)
+ {
+ if (errno == EEXIST)
+ continue;
+
+ printf ("shmget (%d, 0x1000, IPC_CREAT): errno %d\n", 0, errno);
+ exit (1);
+ }
+
+ /* Use SID only if it is 0, retry it otherwise. */
+
+ if (sid == 0)
+ {
+ addr = shmat (sid, NULL, SHM_RND);
+ if (addr == (void *) -1L)
+ {
+ printf ("shmat (%d, NULL, SHM_RND): errno %d\n", sid,
+ errno);
+ exit (1);
+ }
+ }
+ if (shmctl (sid, IPC_RMID, NULL) != 0)
+ {
+ printf ("shmctl (%d, IPC_RMID, NULL): errno %d\n", sid, errno);
+ exit (1);
+ }
+ }
+
+ initialized ();
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.exp b/gdb/testsuite/gdb.base/gcore-shmid0.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-shmid0.exp
@@ -0,0 +1,101 @@
+# Copyright 2007, 2009 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test GDB's handling of gcore for mapping with a name but zero inode.
+
+if { [prepare_for_testing gcore-shmid0.exp gcore-shmid0] } {
+ return -1
+}
+
+# Does this gdb support gcore?
+set test "help gcore"
+gdb_test_multiple $test $test {
+ -re "Undefined command: .gcore.*$gdb_prompt $" {
+ # gcore command not supported -- nothing to test here.
+ unsupported "gdb does not support gcore on this target"
+ return -1;
+ }
+ -re "Save a core file .*$gdb_prompt $" {
+ pass $test
+ }
+}
+
+if { ! [ runto_main ] } then {
+ untested gcore-shmid0.exp
+ return -1
+}
+
+gdb_breakpoint "initialized"
+gdb_breakpoint "unresolved"
+
+set oldtimeout $timeout
+set timeout [expr $oldtimeout + 120]
+
+set test "Continue to initialized."
+gdb_test_multiple "continue" $test {
+ -re "Breakpoint .*, initialized .* at .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Breakpoint .*, unresolved .* at .*\r\n$gdb_prompt $" {
+ set timeout $oldtimeout
+ unsupported $test
+ return -1
+ }
+}
+set timeout $oldtimeout
+
+set escapedfilename [string_to_regexp [standard_output_file gcore-shmid0.test]]
+
+set test "save a corefile"
+gdb_test_multiple "gcore [standard_output_file gcore-shmid0.test]" $test {
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
+ pass $test
+ }
+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
+ unsupported $test
+ }
+}
+
+# Be sure to remove the handle first.
+# But it would get removed even on a kill by GDB as the handle is already
+# deleted, just it is still attached.
+gdb_continue_to_end "finish"
+
+set test "core-file command"
+gdb_test_multiple "core-file [standard_output_file gcore-shmid0.test]" $test {
+ -re ".* program is being debugged already.*y or n. $" {
+ # gdb_load may connect us to a gdbserver.
+ send_gdb "y\n"
+ exp_continue;
+ }
+ -re "Core was generated by .*\r\n\#0 .*\\\(\\\).*\r\n$gdb_prompt $" {
+ # The filename does not fit there anyway so do not check it.
+ pass $test
+ }
+ -re ".*registers from core file: File in wrong format.* $" {
+ fail "core-file command (could not read registers from core file)"
+ }
+}
+
+set test "backtrace"
+gdb_test_multiple "bt" $test {
+ -re "#0 *initialized \\\(\\\) at .*#1 .* main \\\(.*$gdb_prompt $" {
+ pass $test
+ }
+ -re "#0 *initialized \\\(\\\) at .*Cannot access memory at address .*$gdb_prompt $" {
+ fail $test
+ }
+}

View File

@ -0,0 +1,34 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Andrew Burgess <aburgess@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.3-rh-testversion-20041202.patch
;; Check distro name is included in the version output.
diff --git a/gdb/testsuite/gdb.base/fedora-version.exp b/gdb/testsuite/gdb.base/fedora-version.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/fedora-version.exp
@@ -0,0 +1,22 @@
+# Copyright 2023 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, see <http://www.gnu.org/licenses/>.
+
+# Start with a fresh gdb
+clean_restart
+
+# Check the version string contains either the Fedora or RHEL distro
+# name, and that the version number looks roughly correct in format.
+gdb_test "show version" \
+ "GNU gdb \\((Fedora Linux|Red Hat Enterprise Linux)\\) \[0-9\]+\\.\[0-9\]+-\[0-9\]+.*"

View File

@ -0,0 +1,265 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
;; Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
;;=push+jan: It should be replaced by Infinity project.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337
2008-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.8pre.
currently for trivial nonthreaded helloworld with no debug info up to -ggdb2 you
will get:
(gdb) p errno
[some error]
* with -ggdb2 and less "errno" in fact does not exist anywhere as it was
compiled to "(*__errno_location ())" and the macro definition is not present.
Unfortunately gdb will find the TLS symbol and it will try to access it but
as the program has been compiled without -lpthread the TLS base register
(%gs on i386) is not setup and it will result in:
Cannot access memory at address 0x8
Attached suggestion patch how to deal with the most common "errno" symbol
for the most common under-ggdb3 compiled programs.
Original patch hooked into target_translate_tls_address. But its inferior
call invalidates `struct frame *' in the callers - RH BZ 690908.
https://bugzilla.redhat.com/show_bug.cgi?id=1166549
2007-11-03 Jan Kratochvil <jan.kratochvil@redhat.com>
* ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer
DW_AT_MIPS_linkage_name over DW_AT_name now only for non-C.
glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
<81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location
<81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1308,6 +1308,11 @@ process_print_command_args (const char *args, value_print_options *print_opts,
if (exp != nullptr && *exp)
{
+ /* '*((int *(*) (void)) __errno_location) ()' is incompatible with
+ function descriptors. */
+ if (target_has_execution () && strcmp (exp, "errno") == 0)
+ exp = "*(*(int *(*)(void)) __errno_location) ()";
+
/* This setting allows large arrays to be printed by limiting the
number of elements that are loaded into GDB's memory; we only
need to load as many array elements as we plan to print. */
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2005, 2007 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, see <http://www.gnu.org/licenses/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#include <errno.h>
+
+int main()
+{
+ errno = 42;
+
+ return 0; /* breakpoint */
+}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
@@ -0,0 +1,60 @@
+# Copyright 2007 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, see <http://www.gnu.org/licenses/>.
+
+set testfile dw2-errno
+set srcfile ${testfile}.c
+set binfile [standard_output_file ${testfile}]
+
+proc prep {} {
+ global srcdir subdir binfile
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+ runto_main
+
+ gdb_breakpoint [gdb_get_line_number "breakpoint"]
+ gdb_continue_to_breakpoint "breakpoint"
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+prep
+gdb_test "print errno" ".* = 42" "errno with macros=N threads=N"
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+prep
+gdb_test "print errno" ".* = 42" "errno with macros=Y threads=N"
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } {
+ return -1
+}
+prep
+gdb_test "print errno" ".* = 42" "errno with macros=N threads=Y"
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } {
+ return -1
+}
+prep
+gdb_test "print errno" ".* = 42" "errno with macros=Y threads=Y"
+
+# TODO: Test the error on resolving ERRNO with only libc loaded.
+# Just how to find the current libc filename?
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.c b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2005, 2007 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, see <http://www.gnu.org/licenses/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#include <errno.h>
+
+int main()
+{
+ errno = 42;
+
+ return 0; /* breakpoint */
+}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
@@ -0,0 +1,71 @@
+# Copyright 2007 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, see <http://www.gnu.org/licenses/>.
+
+set testfile dw2-errno2
+set srcfile ${testfile}.c
+set binfile [standard_output_file ${testfile}]
+
+proc prep { message {do_xfail 0} } { with_test_prefix $message {
+ global srcdir subdir binfile variant
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}${variant}
+
+ runto_main
+
+ gdb_breakpoint [gdb_get_line_number "breakpoint"]
+ gdb_continue_to_breakpoint "breakpoint"
+
+ gdb_test "gcore ${binfile}${variant}.core" "\r\nSaved corefile .*" "gcore $variant"
+
+ gdb_test "print errno" ".* = 42"
+
+ gdb_test "kill" ".*" "kill" {Kill the program being debugged\? \(y or n\) } "y"
+ gdb_test "core-file ${binfile}${variant}.core" "\r\nCore was generated by .*" "core-file"
+ if $do_xfail {
+ setup_xfail "*-*-*"
+ }
+ gdb_test "print (int) errno" ".* = 42" "print errno for core"
+}}
+
+set variant g2thrN
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g2"] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+prep "macros=N threads=N" 1
+
+set variant g3thrN
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g3"] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+prep "macros=Y threads=N" 1
+
+set variant g2thrY
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g2"] != "" } {
+ return -1
+}
+prep "macros=N threads=Y"
+
+set variant g3thrY
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g3"] != "" } {
+ return -1
+}
+prep "macros=Y threads=Y" 1
+
+# TODO: Test the error on resolving ERRNO with only libc loaded.
+# Just how to find the current libc filename?

View File

@ -0,0 +1,107 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
;; Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
;;=fedoratest
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.c b/gdb/testsuite/gdb.base/step-over-trampoline.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2006 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#include <stdio.h>
+
+int main (void)
+{
+ puts ("hello world");
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.exp b/gdb/testsuite/gdb.base/step-over-trampoline.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.exp
@@ -0,0 +1,59 @@
+# Copyright 2006 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile step-over-trampoline
+set srcfile ${testfile}.c
+set binfile [standard_output_file ${testfile}]
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# For C programs, "start" should stop in main().
+
+gdb_test "start" \
+ "main \\(\\) at .*$srcfile.*" \
+ "start"
+
+# main () at hello2.c:5
+# 5 puts("hello world\n");
+# (gdb) next
+# 0x100007e0 in call___do_global_ctors_aux ()
+
+gdb_test_multiple "next" "invalid `next' output" {
+ -re "\nhello world.*return 0;.*" {
+ pass "stepped over"
+ }
+ -re " in call___do_global_ctors_aux \\(\\).*" {
+ fail "stepped into trampoline"
+ }
+}

View File

@ -0,0 +1,89 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-bz243845-stale-testing-zombie-test.patch
;; Test leftover zombie process (BZ 243845).
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp
@@ -0,0 +1,76 @@
+# Copyright 2007 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# are we on a target board
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+# Start the program running and then wait for a bit, to be sure
+# that it can be attached to.
+
+gdb_exit
+gdb_start
+gdb_load sleep
+
+set gdb_pid [exp_pid -i [board_info host fileid]]
+set test "identified the child GDB"
+if {$gdb_pid != "" && $gdb_pid > 0} {
+ pass $test
+ verbose -log "Child GDB PID $gdb_pid"
+} else {
+ fail $test
+}
+
+set testpid [eval exec sleep 10 &]
+exec sleep 2
+
+set test "attach"
+gdb_test_multiple "attach $testpid" "$test" {
+ -re "Attaching to program.*`?.*'?, process $testpid..*$gdb_prompt $" {
+ pass "$test"
+ }
+ -re "Attaching to program.*`?.*\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" {
+ # Response expected on Cygwin
+ pass "$test"
+ }
+}
+
+# Some time to let GDB spawn its testing child.
+exec sleep 2
+
+set found none
+foreach procpid [glob -directory /proc -type d {[0-9]*}] {
+ if {[catch {open $procpid/status} statusfi]} {
+ continue
+ }
+ set status [read $statusfi]
+ close $statusfi
+ if {1
+ && [regexp -line {^Name:\tgdb$} $status]
+ && [regexp -line {^PPid:\t1$} $status]
+ && [regexp -line "^TracerPid:\t$gdb_pid$" $status]} {
+ set found $procpid
+ verbose -log "Found linux_test_for_tracefork zombie PID $procpid"
+ }
+}
+set test "linux_test_for_tracefork leaves no zombie"
+if {$found eq {none}} {
+ pass $test
+} else {
+ fail $test
+}

View File

@ -0,0 +1,154 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-gcore-buffer-limit-test.patch
;; Test gcore memory and time requirements for large inferiors.
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.c b/gdb/testsuite/gdb.base/gcore-excessive-memory.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.c
@@ -0,0 +1,37 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#include <unistd.h>
+#include <stdlib.h>
+
+#define MEGS 64
+
+int main()
+{
+ void *mem;
+
+ mem = malloc (MEGS * 1024ULL * 1024ULL);
+
+ for (;;)
+ sleep (1);
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.exp b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
@@ -0,0 +1,99 @@
+# Copyright 2008 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+set testfile gcore-excessive-memory
+set srcfile ${testfile}.c
+set shfile [standard_output_file ${testfile}-gdb.sh]
+set corefile [standard_output_file ${testfile}.core]
+set binfile [standard_output_file ${testfile}]
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+set f [open "|getconf PAGESIZE" "r"]
+gets $f pagesize
+close $f
+
+set pid_of_bin [eval exec $binfile &]
+sleep 2
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set pid_of_gdb [exp_pid -i [board_info host fileid]]
+
+gdb_test "attach $pid_of_bin" "Attaching to .*" "attach"
+gdb_test "up 99" "in main .*" "verify we can get to main"
+
+proc memory_v_pages_get {} {
+ global pid_of_gdb pagesize
+ set fd [open "/proc/$pid_of_gdb/statm"]
+ gets $fd line
+ close $fd
+ # number of pages of virtual memory
+ scan $line "%d" drs
+ return $drs
+}
+
+set pages_found [memory_v_pages_get]
+
+# It must be definitely less than `MEGS' of `gcore-excessive-memory.c'.
+set mb_gcore_reserve 4
+verbose -log "pages_found = $pages_found, mb_gcore_reserve = $mb_gcore_reserve"
+set kb_found [expr $pages_found * $pagesize / 1024]
+set kb_permit [expr $kb_found + 1 * 1024 + $mb_gcore_reserve * 1024]
+verbose -log "kb_found = $kb_found, kb_permit = $kb_permit"
+
+# Create the ulimit wrapper.
+set f [open $shfile "w"]
+puts $f "#! /bin/sh"
+puts $f "ulimit -v $kb_permit"
+puts $f "exec $GDB \"\$@\""
+close $f
+remote_exec host "chmod +x $shfile"
+
+gdb_exit
+set GDBold $GDB
+set GDB "$shfile"
+gdb_start
+set GDB $GDBold
+
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set pid_of_gdb [exp_pid -i [board_info host fileid]]
+
+gdb_test "attach $pid_of_bin" "Attaching to .*" "attach"
+gdb_test "up 99" "in main .*" "verify we can get to main"
+
+verbose -log "kb_found before gcore = [expr [memory_v_pages_get] * $pagesize / 1024]"
+
+gdb_test "gcore $corefile" "Saved corefile \[^\n\r\]*" "Save the core file"
+
+verbose -log "kb_found after gcore = [expr [memory_v_pages_get] * $pagesize / 1024]"
+
+# Cleanup.
+exec kill -9 $pid_of_bin

View File

@ -0,0 +1,127 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-section-num-fixup-test.patch
;; Test a crash on libraries missing the .text section.
;;=fedoratest
diff --git a/gdb/testsuite/gdb.base/datalib-lib.c b/gdb/testsuite/gdb.base/datalib-lib.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/datalib-lib.c
@@ -0,0 +1,22 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+int var;
diff --git a/gdb/testsuite/gdb.base/datalib-main.c b/gdb/testsuite/gdb.base/datalib-main.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/datalib-main.c
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/datalib.exp b/gdb/testsuite/gdb.base/datalib.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/datalib.exp
@@ -0,0 +1,56 @@
+# Copyright 2008 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+set testfile datalib
+set srcfilemain ${testfile}-main.c
+set srcfilelib ${testfile}-lib.c
+set libfile [standard_output_file ${testfile}-lib.so]
+set binfile [standard_output_file ${testfile}-main]
+if { [gdb_compile "${srcdir}/${subdir}/${srcfilelib}" "${libfile}" executable [list debug {additional_flags=-shared -nostdlib}]] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfilemain}" "${binfile} ${libfile}" executable {debug}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# We must use a separate library as the main executable is compiled to the
+# address 0 by default and it would get fixed up already at the end of
+# INIT_OBJFILE_SECT_INDICES. We also cannot PRELINK it as PRELINK is missing
+# on ia64. The library must be NOSTDLIB as otherwise some stub code would
+# create the `.text' section there. Also DEBUG option is useful as some of
+# the crashes occur in dwarf2read.c.
+
+# FAIL case:
+# ../../gdb/ia64-tdep.c:2838: internal-error: sect_index_text not initialized
+# A problem internal to GDB has been detected,
+
+gdb_test "start" \
+ "main \\(\\) at .*${srcfilemain}.*" \
+ "start"

View File

@ -0,0 +1,129 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject:
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
;; Fix 'gdb gives highly misleading error when debuginfo pkg is present,
;; but not corresponding binary pkg' (RH BZ 981154).
;;=push+jan
Comments by Sergio Durigan Junior <sergiodj@redhat.com>:
This is the fix for RH BZ #981154
It is mainly a testcase addition, but a minor fix in the gdb/build-id.c
file was also needed.
gdb/build-id.c was added by:
commit dc294be54c96414035eed7d53dafdea0a6f31a72
Author: Tom Tromey <tromey@redhat.com>
Date: Tue Oct 8 19:56:15 2013 +0000
and had a little thinko there. The variable 'filename' needs to be set to
NULL after it is free'd, otherwise the code below thinks that it is still
valid and doesn't print the necessary warning ("Try: yum install ...").
diff --git a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
@@ -0,0 +1,97 @@
+# Copyright (C) 2014 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, see <http://www.gnu.org/licenses/>.
+
+standard_testfile "normal.c"
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
+ return -1
+}
+
+# Get the build-id of the file
+set build_id_debug_file [build_id_debug_filename_get $binfile]
+regsub -all ".debug$" $build_id_debug_file "" build_id_without_debug
+
+# Run to main
+if { ![runto_main] } {
+ return -1
+}
+
+# We first need to generate a corefile
+set escapedfilename [string_to_regexp [standard_output_file gcore.test]]
+set core_supported 0
+gdb_test_multiple "gcore [standard_output_file gcore.test]" \
+ "save a corefile" \
+{
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
+ pass "save a corefile"
+ global core_supported
+ set core_supported 1
+ }
+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
+ unsupported "save a corefile"
+ global core_supported
+ set core_supported 0
+ }
+}
+
+if {!$core_supported} {
+ return -1
+}
+
+# Move the binfile to a temporary name
+remote_exec build "mv $binfile ${binfile}.old"
+
+# Reinitialize GDB and see if we get a yum/dnf warning
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+with_test_prefix "first run:" {
+ gdb_test "set build-id-verbose 1" "" \
+ "set build-id-verbose"
+
+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \
+ "set debug-file-directory"
+
+ gdb_test "core-file [standard_output_file gcore.test]" \
+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install [standard_output_file $build_id_without_debug]\r\n.*" \
+ "test first yum/dnf warning"
+}
+
+# Now we define and create our .build-id
+file mkdir [file dirname [standard_output_file ${build_id_without_debug}]]
+# Cannot use "file link" (from TCL) because it requires the target file to
+# exist.
+remote_exec build "ln -s $binfile [standard_output_file ${build_id_without_debug}]"
+
+# Reinitialize GDB to get the second yum/dnf warning
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+with_test_prefix "second run:" {
+ gdb_test "set build-id-verbose 1" "" \
+ "set build-id-verbose"
+
+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \
+ "set debug-file-directory"
+
+ gdb_test "core-file [standard_output_file gcore.test]" \
+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $binfile\r\n.*" \
+ "test second yum/dnf warning"
+}
+
+# Leaving the link there will cause breakage in the next run.
+remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]"

View File

@ -0,0 +1,19 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
;;=push+jan
diff --git a/gdb/proc-service.list b/gdb/proc-service.list
--- a/gdb/proc-service.list
+++ b/gdb/proc-service.list
@@ -37,4 +37,7 @@
ps_pstop;
ps_ptread;
ps_ptwrite;
+
+ /* gdb-6.6-buildid-locate-rpm.patch */
+ rpmsqEnable;
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,238 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.6-buildid-locate-solib-missing-ids.patch
;; Fix loading of core files without build-ids but with build-ids in executables.
;; Load strictly build-id-checked core files only if no executable is specified
;; (Jan Kratochvil, RH BZ 1339862).
;;=push+jan
gdb returns an incorrect back trace when applying a debuginfo
https://bugzilla.redhat.com/show_bug.cgi?id=1339862
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1320,14 +1320,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
}
{
- struct bfd_build_id *build_id;
+ struct bfd_build_id *build_id = NULL;
strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1);
newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
/* May get overwritten below. */
strcpy (newobj->so_name, newobj->so_original_name);
- build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld);
+ /* In the case the main executable was found according to its build-id
+ (from a core file) prevent loading a different build of a library
+ with accidentally the same SO_NAME.
+
+ It suppresses bogus backtraces (and prints "??" there instead) if
+ the on-disk files no longer match the running program version.
+
+ If the main executable was not loaded according to its build-id do
+ not do any build-id checking of the libraries. There may be missing
+ build-ids dumped in the core file and we would map all the libraries
+ to the only existing file loaded that time - the executable. */
+ if (current_program_space->symfile_object_file != NULL
+ && (current_program_space->symfile_object_file->flags
+ & OBJF_BUILD_ID_CORE_LOADED) != 0)
+ build_id = build_id_addr_get (li->l_ld);
if (build_id != NULL)
{
char *name, *build_id_filename;
@@ -1342,23 +1356,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
xfree (name);
}
else
- {
- debug_print_missing (newobj->so_name, build_id_filename);
-
- /* In the case the main executable was found according to
- its build-id (from a core file) prevent loading
- a different build of a library with accidentally the
- same SO_NAME.
-
- It suppresses bogus backtraces (and prints "??" there
- instead) if the on-disk files no longer match the
- running program version. */
-
- if (current_program_space->symfile_object_file != NULL
- && (current_program_space->symfile_object_file->flags
- & OBJF_BUILD_ID_CORE_LOADED) != 0)
- newobj->so_name[0] = 0;
- }
+ debug_print_missing (newobj->so_name, build_id_filename);
xfree (build_id_filename);
xfree (build_id);
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
@@ -0,0 +1,21 @@
+/* Copyright 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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, see <http://www.gnu.org/licenses/>. */
+
+void
+lib (void)
+{
+}
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
@@ -0,0 +1,25 @@
+/* Copyright 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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, see <http://www.gnu.org/licenses/>. */
+
+extern void lib (void);
+
+int
+main (void)
+{
+ lib ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
@@ -0,0 +1,105 @@
+# Copyright 2016 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, see <http://www.gnu.org/licenses/>.
+
+if {[skip_shlib_tests]} {
+ return 0
+}
+
+set testfile "gcore-buildid-exec-but-not-solib"
+set srcmainfile ${testfile}-main.c
+set srclibfile ${testfile}-lib.c
+set libfile [standard_output_file ${testfile}-lib.so]
+set objfile [standard_output_file ${testfile}-main.o]
+set executable ${testfile}-main
+set binfile [standard_output_file ${executable}]
+set gcorefile [standard_output_file ${executable}.gcore]
+set outdir [file dirname $binfile]
+
+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug additional_flags=-Wl,--build-id"] != ""
+ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
+ unsupported "-Wl,--build-id compilation failed"
+ return -1
+}
+set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"]
+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
+ unsupported "-Wl,--build-id compilation failed"
+ return -1
+}
+
+clean_restart $executable
+gdb_load_shlib $libfile
+
+# Does this gdb support gcore?
+set test "help gcore"
+gdb_test_multiple $test $test {
+ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
+ # gcore command not supported -- nothing to test here.
+ unsupported "gdb does not support gcore on this target"
+ return -1;
+ }
+ -re "Save a core file .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+
+if { ![runto lib] } then {
+ return -1
+}
+
+set escapedfilename [string_to_regexp ${gcorefile}]
+
+set test "save a corefile"
+gdb_test_multiple "gcore ${gcorefile}" $test {
+ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Can't create a corefile\r\n$gdb_prompt $" {
+ unsupported $test
+ return -1
+ }
+}
+
+# Now restart gdb and load the corefile.
+
+clean_restart $executable
+gdb_load_shlib $libfile
+
+set buildid [build_id_debug_filename_get $libfile]
+
+regsub {\.debug$} $buildid {} buildid
+
+set debugdir [standard_output_file ${testfile}-debugdir]
+file delete -force -- $debugdir
+
+file mkdir $debugdir/[file dirname $libfile]
+file copy $libfile $debugdir/${libfile}
+
+file mkdir $debugdir/[file dirname $buildid]
+file copy $libfile $debugdir/${buildid}
+
+remote_exec build "ln -s /lib ${debugdir}/"
+remote_exec build "ln -s /lib64 ${debugdir}/"
+# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2
+
+gdb_test "set solib-absolute-prefix $debugdir"
+
+gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory"
+
+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
+
+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
+
+gdb_test "bt"
+gdb_test "info shared"

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More