Compare commits
No commits in common. 'i8c' and 'c9' have entirely different histories.
@ -1 +1 @@
|
|||||||
SOURCES/binutils-2.30.tar.bz2
|
SOURCES/binutils-2.40.tar.xz
|
||||||
|
@ -1 +1 @@
|
|||||||
33d807f7fa680b00439eb5560acd0c2ef645e5f9 SOURCES/binutils-2.30.tar.bz2
|
fee4fbef9d632afc1988dd631d7f75d4394b7f8d SOURCES/binutils-2.40.tar.xz
|
||||||
|
@ -1,146 +0,0 @@
|
|||||||
From a985e9b9deabd81e16754584f4397a638e9d3f36 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Nick Clifton <nickc@redhat.com>
|
|
||||||
Date: Mon, 5 Feb 2018 09:12:42 +0000
|
|
||||||
Subject: [PATCH] Import patch from mainline to remove PROVODE qualifiers
|
|
||||||
around definitions of __CTOR_LIST__ and __DTOR_LIST__ in PE linker scripts.
|
|
||||||
|
|
||||||
PR 22762
|
|
||||||
* scripttempl/pe.sc: Remove PROVIDE()s from __CTOR_LIST__ and
|
|
||||||
__DTOR_LIST__ symbols. Add a comment explaining why this is
|
|
||||||
necessary.
|
|
||||||
* scripttemp/pep.sc: Likewise.
|
|
||||||
* ld.texinfo (PROVIDE): Add a note about the effect of common
|
|
||||||
symbols.
|
|
||||||
---
|
|
||||||
ld/ChangeLog | 14 ++++++++++++++
|
|
||||||
ld/ld.texinfo | 6 ++++++
|
|
||||||
ld/scripttempl/pe.sc | 24 ++++++++++++++++++++----
|
|
||||||
ld/scripttempl/pep.sc | 24 ++++++++++++++++++++----
|
|
||||||
4 files changed, 60 insertions(+), 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/ld/ChangeLog b/ld/ChangeLog
|
|
||||||
index 0f00265029c..bf129a121cc 100644
|
|
||||||
--- a/ld/ChangeLog
|
|
||||||
+++ b/ld/ChangeLog
|
|
||||||
@@ -1,3 +1,17 @@
|
|
||||||
+2018-02-05 Nick Clifton <nickc@redhat.com>
|
|
||||||
+
|
|
||||||
+ Import from mainline:
|
|
||||||
+
|
|
||||||
+ 2018-02-03 Nick Clifton <nickc@redhat.com>
|
|
||||||
+
|
|
||||||
+ PR 22762
|
|
||||||
+ * scripttempl/pe.sc: Remove PROVIDE()s from __CTOR_LIST__ and
|
|
||||||
+ __DTOR_LIST__ symbols. Add a comment explaining why this is
|
|
||||||
+ necessary.
|
|
||||||
+ * scripttemp/pep.sc: Likewise.
|
|
||||||
+ * ld.texinfo (PROVIDE): Add a note about the effect of common
|
|
||||||
+ symbols.
|
|
||||||
+
|
|
||||||
2018-01-27 Nick Clifton <nickc@redhat.com>
|
|
||||||
|
|
||||||
This is the 2.30 release:
|
|
||||||
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
|
|
||||||
index c89915f1aaa..764c4017c7b 100644
|
|
||||||
--- a/ld/ld.texinfo
|
|
||||||
+++ b/ld/ld.texinfo
|
|
||||||
@@ -4001,6 +4001,12 @@ underscore), the linker will silently use the definition in the program.
|
|
||||||
If the program references @samp{etext} but does not define it, the
|
|
||||||
linker will use the definition in the linker script.
|
|
||||||
|
|
||||||
+Note - the @code{PROVIDE} directive considers a common symbol to be
|
|
||||||
+defined, even though such a symbol could be combined with the symbol
|
|
||||||
+that the @code{PROVIDE} would create. This is particularly important
|
|
||||||
+when considering constructor and destructor list symbols such as
|
|
||||||
+@samp{__CTOR_LIST__} as these are often defined as common symbols.
|
|
||||||
+
|
|
||||||
@node PROVIDE_HIDDEN
|
|
||||||
@subsection PROVIDE_HIDDEN
|
|
||||||
@cindex PROVIDE_HIDDEN
|
|
||||||
diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc
|
|
||||||
index c8a45ca09d1..f56d783ea03 100644
|
|
||||||
--- a/ld/scripttempl/pe.sc
|
|
||||||
+++ b/ld/scripttempl/pe.sc
|
|
||||||
@@ -98,8 +98,22 @@ SECTIONS
|
|
||||||
${RELOCATING+*(.glue_7t)}
|
|
||||||
${RELOCATING+*(.glue_7)}
|
|
||||||
${CONSTRUCTING+
|
|
||||||
- PROVIDE(___CTOR_LIST__ = .);
|
|
||||||
- PROVIDE(__CTOR_LIST__ = .);
|
|
||||||
+ /* Note: we always define __CTOR_LIST__ and ___CTOR_LIST__ here,
|
|
||||||
+ we do not PROVIDE them. This is because the ctors.o startup
|
|
||||||
+ code in libgcc defines them as common symbols, with the
|
|
||||||
+ expectation that they will be overridden by the definitions
|
|
||||||
+ here. If we PROVIDE the symbols then they will not be
|
|
||||||
+ overridden and global constructors will not be run.
|
|
||||||
+
|
|
||||||
+ This does mean that it is not possible for a user to define
|
|
||||||
+ their own __CTOR_LIST__ and __DTOR_LIST__ symbols. If that
|
|
||||||
+ ability is needed a custom linker script will have to be
|
|
||||||
+ used. (The custom script can just be a copy of this script
|
|
||||||
+ with the PROVIDE() qualifiers added).
|
|
||||||
+
|
|
||||||
+ See PR 22762 for more details. */
|
|
||||||
+ ___CTOR_LIST__ = .;
|
|
||||||
+ __CTOR_LIST__ = .;
|
|
||||||
LONG (-1);
|
|
||||||
KEEP(*(.ctors));
|
|
||||||
KEEP(*(.ctor));
|
|
||||||
@@ -107,8 +121,10 @@ SECTIONS
|
|
||||||
LONG (0);
|
|
||||||
}
|
|
||||||
${CONSTRUCTING+
|
|
||||||
- PROVIDE(___DTOR_LIST__ = .);
|
|
||||||
- PROVIDE(__DTOR_LIST__ = .);
|
|
||||||
+ /* See comment about __CTOR_LIST__ above. The same reasoning
|
|
||||||
+ applies here too. */
|
|
||||||
+ ___DTOR_LIST__ = .;
|
|
||||||
+ __DTOR_LIST__ = .;
|
|
||||||
LONG (-1);
|
|
||||||
KEEP(*(.dtors));
|
|
||||||
KEEP(*(.dtor));
|
|
||||||
diff --git a/ld/scripttempl/pep.sc b/ld/scripttempl/pep.sc
|
|
||||||
index 8daacb27630..3c6c84da9bf 100644
|
|
||||||
--- a/ld/scripttempl/pep.sc
|
|
||||||
+++ b/ld/scripttempl/pep.sc
|
|
||||||
@@ -99,8 +99,22 @@ SECTIONS
|
|
||||||
${RELOCATING+*(.glue_7)}
|
|
||||||
${CONSTRUCTING+. = ALIGN(8);}
|
|
||||||
${CONSTRUCTING+
|
|
||||||
- PROVIDE(___CTOR_LIST__ = .);
|
|
||||||
- PROVIDE(__CTOR_LIST__ = .);
|
|
||||||
+ /* Note: we always define __CTOR_LIST__ and ___CTOR_LIST__ here,
|
|
||||||
+ we do not PROVIDE them. This is because the ctors.o startup
|
|
||||||
+ code in libgcc defines them as common symbols, with the
|
|
||||||
+ expectation that they will be overridden by the definitions
|
|
||||||
+ here. If we PROVIDE the symbols then they will not be
|
|
||||||
+ overridden and global constructors will not be run.
|
|
||||||
+
|
|
||||||
+ This does mean that it is not possible for a user to define
|
|
||||||
+ their own __CTOR_LIST__ and __DTOR_LIST__ symbols. If that
|
|
||||||
+ ability is needed a custom linker script will have to be
|
|
||||||
+ used. (The custom script can just be a copy of this script
|
|
||||||
+ with the PROVIDE() qualifiers added).
|
|
||||||
+
|
|
||||||
+ See PR 22762 for more details. */
|
|
||||||
+ ___CTOR_LIST__ = .;
|
|
||||||
+ __CTOR_LIST__ = .;
|
|
||||||
LONG (-1); LONG (-1);
|
|
||||||
KEEP (*(.ctors));
|
|
||||||
KEEP (*(.ctor));
|
|
||||||
@@ -108,8 +122,10 @@ SECTIONS
|
|
||||||
LONG (0); LONG (0);
|
|
||||||
}
|
|
||||||
${CONSTRUCTING+
|
|
||||||
- PROVIDE(___DTOR_LIST__ = .);
|
|
||||||
- PROVIDE(__DTOR_LIST__ = .);
|
|
||||||
+ /* See comment about __CTOR_LIST__ above. The same reasoning
|
|
||||||
+ applies here too. */
|
|
||||||
+ ___DTOR_LIST__ = .;
|
|
||||||
+ __DTOR_LIST__ = .;
|
|
||||||
LONG (-1); LONG (-1);
|
|
||||||
KEEP (*(.dtors));
|
|
||||||
KEEP (*(.dtor));
|
|
||||||
--
|
|
||||||
2.18.2
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/bfd/elf.c binutils-2.40-new/bfd/elf.c
|
||||||
|
--- binutils-2.40/bfd/elf.c 2023-04-14 16:12:16.185323541 +0200
|
||||||
|
+++ binutils-2.40-new/bfd/elf.c 2023-04-14 16:12:27.583371759 +0200
|
||||||
|
@@ -9048,6 +9048,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd
|
||||||
|
bfd_set_error (bfd_error_file_too_big);
|
||||||
|
goto error_return_verdef;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (amt == 0)
|
||||||
|
+ goto error_return_verdef;
|
||||||
|
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
|
||||||
|
if (elf_tdata (abfd)->verdef == NULL)
|
||||||
|
goto error_return_verdef;
|
||||||
|
@@ -9151,6 +9154,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd
|
||||||
|
bfd_set_error (bfd_error_file_too_big);
|
||||||
|
goto error_return;
|
||||||
|
}
|
||||||
|
+ if (amt == 0)
|
||||||
|
+ goto error_return;
|
||||||
|
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
|
||||||
|
if (elf_tdata (abfd)->verdef == NULL)
|
||||||
|
goto error_return;
|
@ -0,0 +1,11 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/bfd/elfnn-aarch64.c binutils-2.40-new/bfd/elfnn-aarch64.c
|
||||||
|
--- binutils-2.40/bfd/elfnn-aarch64.c 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/bfd/elfnn-aarch64.c 2023-03-09 14:51:55.011379383 +0100
|
||||||
|
@@ -5487,6 +5487,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;
|
@ -0,0 +1,12 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/config/override.m4 binutils-2.40-new/config/override.m4
|
||||||
|
--- binutils-2.40/config/override.m4 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/config/override.m4 2023-03-09 14:52:03.599278848 +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
|
@ -0,0 +1,83 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/configure binutils-2.40-new/configure
|
||||||
|
--- binutils-2.40/configure 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/configure 2023-03-09 14:51:56.227365462 +0100
|
||||||
|
@@ -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 -rupN --no-dereference binutils-2.40/configure.ac binutils-2.40-new/configure.ac
|
||||||
|
--- binutils-2.40/configure.ac 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/configure.ac 2023-03-09 14:51:56.228365450 +0100
|
||||||
|
@@ -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
|
@ -0,0 +1,33 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/bfd/Makefile.am binutils-2.40-new/bfd/Makefile.am
|
||||||
|
--- binutils-2.40/bfd/Makefile.am 2023-03-09 14:51:48.814448632 +0100
|
||||||
|
+++ binutils-2.40-new/bfd/Makefile.am 2023-03-09 14:51:48.819448577 +0100
|
||||||
|
@@ -38,7 +38,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 -rupN --no-dereference binutils-2.40/bfd/Makefile.in binutils-2.40-new/bfd/Makefile.in
|
||||||
|
--- binutils-2.40/bfd/Makefile.in 2023-03-09 14:51:48.815448621 +0100
|
||||||
|
+++ binutils-2.40-new/bfd/Makefile.in 2023-03-09 14:51:48.819448577 +0100
|
||||||
|
@@ -292,7 +292,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
|
||||||
|
@@ -517,7 +517,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
|
@ -0,0 +1,126 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/binutils/readelf.c binutils-2.40-new/binutils/readelf.c
|
||||||
|
--- binutils-2.40/binutils/readelf.c 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/binutils/readelf.c 2023-03-09 14:51:51.335420794 +0100
|
||||||
|
@@ -22858,46 +22858,53 @@ process_file (char * file_name)
|
||||||
|
Filedata * filedata = NULL;
|
||||||
|
struct stat statbuf;
|
||||||
|
char armag[SARMAG];
|
||||||
|
- bool ret = true;
|
||||||
|
+ bool ret = false;
|
||||||
|
+ char * name;
|
||||||
|
+ char * saved_program_name;
|
||||||
|
+
|
||||||
|
+ /* Overload program_name to include file_name. Doing this means
|
||||||
|
+ that warning/error messages will positively identify the file
|
||||||
|
+ concerned even when multiple instances of readelf are running. */
|
||||||
|
+ name = xmalloc (strlen (program_name) + strlen (file_name) + 3);
|
||||||
|
+ sprintf (name, "%s: %s", program_name, file_name);
|
||||||
|
+ saved_program_name = program_name;
|
||||||
|
+ program_name = name;
|
||||||
|
|
||||||
|
if (stat (file_name, &statbuf) < 0)
|
||||||
|
{
|
||||||
|
if (errno == ENOENT)
|
||||||
|
- error (_("'%s': No such file\n"), file_name);
|
||||||
|
+ error (_("No such file\n"));
|
||||||
|
else
|
||||||
|
- error (_("Could not locate '%s'. System error message: %s\n"),
|
||||||
|
- file_name, strerror (errno));
|
||||||
|
- return false;
|
||||||
|
+ error (_("Could not locate file. System error message: %s\n"),
|
||||||
|
+ strerror (errno));
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! S_ISREG (statbuf.st_mode))
|
||||||
|
{
|
||||||
|
- error (_("'%s' is not an ordinary file\n"), file_name);
|
||||||
|
- return false;
|
||||||
|
+ error (_("Not an ordinary file\n"));
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
filedata = calloc (1, sizeof * filedata);
|
||||||
|
if (filedata == NULL)
|
||||||
|
{
|
||||||
|
error (_("Out of memory allocating file data structure\n"));
|
||||||
|
- return false;
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
filedata->file_name = file_name;
|
||||||
|
filedata->handle = fopen (file_name, "rb");
|
||||||
|
if (filedata->handle == NULL)
|
||||||
|
{
|
||||||
|
- error (_("Input file '%s' is not readable.\n"), file_name);
|
||||||
|
- free (filedata);
|
||||||
|
- return false;
|
||||||
|
+ error (_("Not readable\n"));
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fread (armag, SARMAG, 1, filedata->handle) != 1)
|
||||||
|
{
|
||||||
|
- error (_("%s: Failed to read file's magic number\n"), file_name);
|
||||||
|
- fclose (filedata->handle);
|
||||||
|
- free (filedata);
|
||||||
|
- return false;
|
||||||
|
+ error (_("Failed to read file's magic number\n"));
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
filedata->file_size = statbuf.st_size;
|
||||||
|
@@ -22905,33 +22912,39 @@ process_file (char * file_name)
|
||||||
|
|
||||||
|
if (memcmp (armag, ARMAG, SARMAG) == 0)
|
||||||
|
{
|
||||||
|
- if (! process_archive (filedata, false))
|
||||||
|
- ret = false;
|
||||||
|
+ if (process_archive (filedata, false))
|
||||||
|
+ ret = true;
|
||||||
|
}
|
||||||
|
else if (memcmp (armag, ARMAGT, SARMAG) == 0)
|
||||||
|
{
|
||||||
|
- if ( ! process_archive (filedata, true))
|
||||||
|
- ret = false;
|
||||||
|
+ if (process_archive (filedata, true))
|
||||||
|
+ ret = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (do_archive_index && !check_all)
|
||||||
|
- error (_("File %s is not an archive so its index cannot be displayed.\n"),
|
||||||
|
- file_name);
|
||||||
|
+ error (_("Not an archive so its index cannot be displayed.\n"));
|
||||||
|
|
||||||
|
rewind (filedata->handle);
|
||||||
|
filedata->archive_file_size = filedata->archive_file_offset = 0;
|
||||||
|
|
||||||
|
- if (! process_object (filedata))
|
||||||
|
- ret = false;
|
||||||
|
+ if (process_object (filedata))
|
||||||
|
+ ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
- fclose (filedata->handle);
|
||||||
|
- free (filedata->section_headers);
|
||||||
|
- free (filedata->program_headers);
|
||||||
|
- free (filedata->string_table);
|
||||||
|
- free (filedata->dump.dump_sects);
|
||||||
|
- free (filedata);
|
||||||
|
+ done:
|
||||||
|
+ if (filedata)
|
||||||
|
+ {
|
||||||
|
+ if (filedata->handle != NULL)
|
||||||
|
+ fclose (filedata->handle);
|
||||||
|
+ free (filedata->section_headers);
|
||||||
|
+ free (filedata->program_headers);
|
||||||
|
+ free (filedata->string_table);
|
||||||
|
+ free (filedata->dump.dump_sects);
|
||||||
|
+ free (filedata);
|
||||||
|
+ }
|
||||||
|
+ free (program_name);
|
||||||
|
+ program_name = saved_program_name;
|
||||||
|
|
||||||
|
free (ba_cache.strtab);
|
||||||
|
ba_cache.strtab = NULL;
|
@ -0,0 +1,304 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-elfvers/vers24.rd binutils-2.40-new/ld/testsuite/ld-elfvers/vers24.rd
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-elfvers/vers24.rd 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-elfvers/vers24.rd 2023-03-09 14:51:58.684337020 +0100
|
||||||
|
@@ -7,9 +7,9 @@ Symbol table '.dynsym' contains [0-9]+ e
|
||||||
|
# And ensure the dynamic symbol table contains at least x@VERS.0
|
||||||
|
# and foo@@VERS.0 symbols
|
||||||
|
#...
|
||||||
|
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0
|
||||||
|
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.*
|
||||||
|
#...
|
||||||
|
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0
|
||||||
|
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.*
|
||||||
|
#...
|
||||||
|
Symbol table '.symtab' contains [0-9]+ entries:
|
||||||
|
#pass
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-10.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-10.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-10.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-10.d 2023-03-09 14:51:58.683337032 +0100
|
||||||
|
@@ -32,7 +32,8 @@ hook called: claim_file tmpdir/func.o \[
|
||||||
|
hook called: claim_file tmpdir/libtext.a \[@.* not claimed
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||||
|
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-11.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-11.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-11.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-11.d 2023-03-09 14:51:58.683337032 +0100
|
||||||
|
@@ -35,8 +35,9 @@ hook called: claim_file tmpdir/func.o \[
|
||||||
|
hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||||
|
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF
|
||||||
|
+Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-13.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-13.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-13.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-13.d 2023-03-09 14:51:58.679337079 +0100
|
||||||
|
@@ -23,5 +23,3 @@ hook called: claim_file tmpdir/main.o \[
|
||||||
|
hook called: claim_file .*/ld/testsuite/ld-plugin/func.c \[@0/.* CLAIMED
|
||||||
|
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||||
|
#...
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
-#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-14.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-14.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-14.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-14.d 2023-03-09 14:51:58.679337079 +0100
|
||||||
|
@@ -27,7 +27,6 @@ hook called: claim_file .*/ld/testsuite/
|
||||||
|
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-.*: tmpdir/main.o: in function `main':
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-15.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-15.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-15.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-15.d 2023-03-09 14:51:58.679337079 +0100
|
||||||
|
@@ -28,7 +28,6 @@ hook called: claim_file .*/ld/testsuite/
|
||||||
|
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-.*: tmpdir/main.o: in function `main':
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-16.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-16.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-16.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-16.d 2023-03-09 14:51:58.680337067 +0100
|
||||||
|
@@ -30,9 +30,8 @@ hook called: claim_file .*/ld/testsuite/
|
||||||
|
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||||
|
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
-.*: tmpdir/main.o: in function `main':
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-17.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-17.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-17.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-17.d 2023-03-09 14:51:58.680337067 +0100
|
||||||
|
@@ -31,7 +31,8 @@ hook called: claim_file .*/ld/testsuite/
|
||||||
|
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||||
|
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-18.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-18.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-18.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-18.d 2023-03-09 14:51:58.683337032 +0100
|
||||||
|
@@ -32,7 +32,8 @@ hook called: claim_file .*/ld/testsuite/
|
||||||
|
hook called: claim_file tmpdir/libtext.a \[@.* not claimed
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||||
|
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-19.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-19.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-19.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-19.d 2023-03-09 14:51:58.684337020 +0100
|
||||||
|
@@ -35,8 +35,9 @@ hook called: claim_file .*/ld/testsuite/
|
||||||
|
hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||||
|
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF
|
||||||
|
+Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-20.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-20.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-20.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-20.d 2023-03-09 14:51:58.680337067 +0100
|
||||||
|
@@ -2,6 +2,5 @@ hook called: all symbols read.
|
||||||
|
Input: func.c \(tmpdir/libfunc.a\)
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
-.*: tmpdir/main.o: in function `main':
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-21.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-21.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-21.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-21.d 2023-03-09 14:51:58.680337067 +0100
|
||||||
|
@@ -2,6 +2,5 @@ hook called: all symbols read.
|
||||||
|
Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\)
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
-.*: tmpdir/main.o: in function `main':
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-22.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-22.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-22.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-22.d 2023-03-09 14:51:58.680337067 +0100
|
||||||
|
@@ -2,6 +2,5 @@ Claimed: tmpdir/libfunc.a \[@.*
|
||||||
|
hook called: all symbols read.
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
-.*: tmpdir/main.o: in function `main':
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-23.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-23.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-23.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-23.d 2023-03-09 14:51:58.681337056 +0100
|
||||||
|
@@ -2,6 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func.
|
||||||
|
hook called: all symbols read.
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
-.*: tmpdir/main.o: in function `main':
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-24.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-24.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-24.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-24.d 2023-03-09 14:51:58.681337056 +0100
|
||||||
|
@@ -2,4 +2,5 @@ hook called: all symbols read.
|
||||||
|
Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\)
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-25.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-25.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-25.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-25.d 2023-03-09 14:51:58.681337056 +0100
|
||||||
|
@@ -2,4 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func.
|
||||||
|
hook called: all symbols read.
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-28.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-28.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-28.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-28.d 2023-03-09 14:51:58.684337020 +0100
|
||||||
|
@@ -1 +1,2 @@
|
||||||
|
.*: error: Error
|
||||||
|
+#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-29.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-29.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-29.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-29.d 2023-03-09 14:51:58.681337056 +0100
|
||||||
|
@@ -1 +1,2 @@
|
||||||
|
.*: warning: Warning
|
||||||
|
+#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-30.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-30.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-30.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-30.d 2023-03-09 14:51:58.681337056 +0100
|
||||||
|
@@ -24,3 +24,4 @@ hook called: claim_file tmpdir/main.o \[
|
||||||
|
hook called: claim_file tmpdir/func.o \[@0/.* not claimed
|
||||||
|
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||||
|
hook called: claim_file tmpdir/libempty.a \[@.* not claimed
|
||||||
|
+#pass
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-6.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-6.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-6.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-6.d 2023-03-09 14:51:58.682337044 +0100
|
||||||
|
@@ -27,7 +27,6 @@ hook called: claim_file tmpdir/func.o \[
|
||||||
|
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-.*: tmpdir/main.o: in function `main':
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-7.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-7.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-7.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-7.d 2023-03-09 14:51:58.682337044 +0100
|
||||||
|
@@ -28,7 +28,6 @@ hook called: claim_file tmpdir/func.o \[
|
||||||
|
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-.*: tmpdir/main.o: in function `main':
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-8.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-8.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-8.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-8.d 2023-03-09 14:51:58.684337020 +0100
|
||||||
|
@@ -30,9 +30,8 @@ hook called: claim_file tmpdir/func.o \[
|
||||||
|
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||||
|
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
-.*: tmpdir/main.o: in function `main':
|
||||||
|
-.*main.c.*: undefined reference to `\.?func'
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin-9.d binutils-2.40-new/ld/testsuite/ld-plugin/plugin-9.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin-9.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin-9.d 2023-03-09 14:51:58.682337044 +0100
|
||||||
|
@@ -31,7 +31,8 @@ hook called: claim_file tmpdir/func.o \[
|
||||||
|
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||||
|
#...
|
||||||
|
hook called: all symbols read.
|
||||||
|
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||||
|
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/plugin.exp binutils-2.40-new/ld/testsuite/ld-plugin/plugin.exp
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/plugin.exp 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/plugin.exp 2023-03-09 14:51:58.685337009 +0100
|
||||||
|
@@ -117,6 +117,12 @@ if { $can_compile && !$failed_compile }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+# I do not know why, but the underscore prefix test is going
|
||||||
|
+# wrong on ppc64le targets. So override it here.
|
||||||
|
+if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } {
|
||||||
|
+ set _ ""
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o"
|
||||||
|
set testobjfiles_notext "tmpdir/main.o tmpdir/func.o"
|
||||||
|
set testsrcfiles "tmpdir/main.o $srcdir/$subdir/func.c tmpdir/text.o"
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-plugin/pr20070.d binutils-2.40-new/ld/testsuite/ld-plugin/pr20070.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-plugin/pr20070.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-plugin/pr20070.d 2023-03-09 14:51:58.683337032 +0100
|
||||||
|
@@ -5,5 +5,6 @@ Sym: 'weakdef' Resolution: LDPR_PREVAILI
|
||||||
|
Sym: 'undef' Resolution: LDPR_UNDEF
|
||||||
|
Sym: 'weakundef' Resolution: LDPR_UNDEF
|
||||||
|
Sym: 'common' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||||
|
+#...
|
||||||
|
hook called: cleanup.
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-srec/srec.exp binutils-2.40-new/ld/testsuite/ld-srec/srec.exp
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-srec/srec.exp 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-srec/srec.exp 2023-03-09 14:51:58.683337032 +0100
|
||||||
|
@@ -21,6 +21,8 @@
|
||||||
|
|
||||||
|
# Get the offset from an S-record line to the start of the data.
|
||||||
|
|
||||||
|
+return
|
||||||
|
+
|
||||||
|
proc srec_off { l } {
|
||||||
|
if [string match "S1*" $l] {
|
||||||
|
return 8
|
@ -0,0 +1,13 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/ld/ldlang.c binutils-2.40-new/ld/ldlang.c
|
||||||
|
--- binutils-2.40/ld/ldlang.c 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/ldlang.c 2023-06-14 16:26:54.425556661 +0200
|
||||||
|
@@ -649,7 +649,8 @@ wild_sort (lang_wild_statement_type *wil
|
||||||
|
looking at the sections for this file. */
|
||||||
|
|
||||||
|
/* Find the correct node to append this section. */
|
||||||
|
- if (compare_section (sec->spec.sorted, section, (*tree)->section) < 0)
|
||||||
|
+ if (sec && sec->spec.sorted != none && sec->spec.sorted != by_none
|
||||||
|
+ && compare_section (sec->spec.sorted, section, (*tree)->section) < 0)
|
||||||
|
tree = &((*tree)->left);
|
||||||
|
else
|
||||||
|
tree = &((*tree)->right);
|
@ -0,0 +1,192 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/gold/i386.cc binutils-2.40-new/gold/i386.cc
|
||||||
|
--- binutils-2.40/gold/i386.cc 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/gold/i386.cc 2023-03-09 14:52:02.399293207 +0100
|
||||||
|
@@ -360,7 +360,11 @@ class Target_i386 : public Sized_target<
|
||||||
|
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<
|
||||||
|
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<
|
||||||
|
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(Layou
|
||||||
|
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.
|
@ -0,0 +1,19 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/gold/layout.cc binutils-2.40-new/gold/layout.cc
|
||||||
|
--- binutils-2.40/gold/layout.cc 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/gold/layout.cc 2023-03-09 14:51:59.908322697 +0100
|
||||||
|
@@ -872,6 +872,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;
|
||||||
|
@@ -882,6 +883,7 @@ Layout::get_output_section(const char* n
|
||||||
|
if (p != this->section_name_map_.end())
|
||||||
|
os = p->second;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (os == NULL)
|
@ -0,0 +1,67 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/bfd/config.bfd binutils-2.40-new/bfd/config.bfd
|
||||||
|
--- binutils-2.40/bfd/config.bfd 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/bfd/config.bfd 2023-03-09 14:52:01.154308002 +0100
|
||||||
|
@@ -501,7 +501,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
|
||||||
|
@@ -1494,7 +1494,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
|
||||||
|
;;
|
||||||
|
diff -rupN --no-dereference binutils-2.40/gold/configure binutils-2.40-new/gold/configure
|
||||||
|
--- binutils-2.40/gold/configure 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/gold/configure 2023-03-09 14:52:01.152308026 +0100
|
||||||
|
@@ -5255,7 +5255,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 -rupN --no-dereference binutils-2.40/gold/configure.ac binutils-2.40-new/gold/configure.ac
|
||||||
|
--- binutils-2.40/gold/configure.ac 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/gold/configure.ac 2023-03-09 14:52:01.153308014 +0100
|
||||||
|
@@ -182,7 +182,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
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/configure.tgt binutils-2.40-new/ld/configure.tgt
|
||||||
|
--- binutils-2.40/ld/configure.tgt 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/configure.tgt 2023-03-09 14:52:01.153308014 +0100
|
||||||
|
@@ -263,7 +263,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
|
||||||
|
;;
|
||||||
|
@@ -1088,7 +1088,7 @@ loongarch64-*) targ_emul=elf64loongarch
|
||||||
|
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
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/ltmain.sh binutils-2.40-new/ltmain.sh
|
||||||
|
--- binutils-2.40/ltmain.sh 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ltmain.sh 2023-03-09 14:52:04.803264344 +0100
|
||||||
|
@@ -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
|
@ -0,0 +1,30 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/bfd/bfd-in2.h binutils-2.40-new/bfd/bfd-in2.h
|
||||||
|
--- binutils-2.40/bfd/bfd-in2.h 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/bfd/bfd-in2.h 2023-03-09 14:51:50.115434327 +0100
|
||||||
|
@@ -30,11 +30,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
|
||||||
|
diff -rupN --no-dereference binutils-2.40/bfd/bfd-in.h binutils-2.40-new/bfd/bfd-in.h
|
||||||
|
--- binutils-2.40/bfd/bfd-in.h 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/bfd/bfd-in.h 2023-03-09 14:51:50.114434338 +0100
|
||||||
|
@@ -23,11 +23,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
|
@ -0,0 +1,45 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/binutils/objcopy.c binutils-2.40-new/binutils/objcopy.c
|
||||||
|
--- binutils-2.40/binutils/objcopy.c 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/binutils/objcopy.c 2023-03-09 14:52:06.043249302 +0100
|
||||||
|
@@ -2403,6 +2403,8 @@ merge_gnu_build_notes (bfd * ab
|
||||||
|
other note then if they are both of the same type (open
|
||||||
|
or func) then they can be merged and one deleted. If
|
||||||
|
they are of different types then they cannot be merged. */
|
||||||
|
+ objcopy_internal_note * prev_note = NULL;
|
||||||
|
+
|
||||||
|
for (pnote = pnotes; pnote < pnotes_end; pnote ++)
|
||||||
|
{
|
||||||
|
/* Skip already deleted notes.
|
||||||
|
@@ -2424,7 +2426,9 @@ merge_gnu_build_notes (bfd * ab
|
||||||
|
objcopy_internal_note * back;
|
||||||
|
|
||||||
|
/* Rule 2: Check to see if there is an identical previous note. */
|
||||||
|
- for (iter = 0, back = pnote - 1; back >= pnotes; back --)
|
||||||
|
+ for (iter = 0, back = prev_note ? prev_note : pnote - 1;
|
||||||
|
+ back >= pnotes;
|
||||||
|
+ back --)
|
||||||
|
{
|
||||||
|
if (is_deleted_note (back))
|
||||||
|
continue;
|
||||||
|
@@ -2486,11 +2490,18 @@ merge_gnu_build_notes (bfd * ab
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-#if DEBUG_MERGE
|
||||||
|
+
|
||||||
|
+
|
||||||
|
if (! is_deleted_note (pnote))
|
||||||
|
- merge_debug ("Unable to do anything with note at %#08lx\n",
|
||||||
|
- (pnote->note.namedata - (char *) contents) - 12);
|
||||||
|
+ {
|
||||||
|
+ /* Keep a pointer to this note, so that we can
|
||||||
|
+ start the next search for rule 2 matches here. */
|
||||||
|
+ prev_note = pnote;
|
||||||
|
+#if DEBUG_MERGE
|
||||||
|
+ merge_debug ("Unable to do anything with note at %#08lx\n",
|
||||||
|
+ (pnote->note.namedata - (char *) contents) - 12);
|
||||||
|
#endif
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Resort the notes. */
|
@ -0,0 +1,36 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/binutils/readelf.c binutils-2.40-new/binutils/readelf.c
|
||||||
|
--- binutils-2.40/binutils/readelf.c 2023-03-09 14:51:52.549407223 +0100
|
||||||
|
+++ binutils-2.40-new/binutils/readelf.c 2023-03-09 14:51:53.790393244 +0100
|
||||||
|
@@ -13247,11 +13247,13 @@ print_dynamic_symbol (Filedata *filedata
|
||||||
|
unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
|
||||||
|
|
||||||
|
printf (" %-7s", get_symbol_visibility (vis));
|
||||||
|
+#if 0
|
||||||
|
/* Check to see if any other bits in the st_other field are set.
|
||||||
|
Note - displaying this information disrupts the layout of the
|
||||||
|
table being generated, but for the moment this case is very rare. */
|
||||||
|
if (psym->st_other ^ vis)
|
||||||
|
printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis));
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx));
|
||||||
|
|
||||||
|
@@ -13305,7 +13307,17 @@ print_dynamic_symbol (Filedata *filedata
|
||||||
|
version_string);
|
||||||
|
}
|
||||||
|
|
||||||
|
- putchar ('\n');
|
||||||
|
+#if 1
|
||||||
|
+ {
|
||||||
|
+ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
|
||||||
|
+
|
||||||
|
+ /* Check to see if any other bits in the st_other field are set. */
|
||||||
|
+ if (psym->st_other ^ vis)
|
||||||
|
+ printf (" \t[%s]", get_symbol_other (filedata, psym->st_other ^ vis));
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+ putchar ('\n');
|
||||||
|
|
||||||
|
if (ELF_ST_BIND (psym->st_info) == STB_LOCAL
|
||||||
|
&& section != NULL
|
@ -0,0 +1,169 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/bfd/elfxx-x86.c binutils-2.40-new/bfd/elfxx-x86.c
|
||||||
|
--- binutils-2.40/bfd/elfxx-x86.c 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/bfd/elfxx-x86.c 2023-03-09 14:51:52.557407133 +0100
|
||||||
|
@@ -105,7 +105,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
|
||||||
|
@@ -123,7 +123,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
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-i386/pltgot-1.d binutils-2.40-new/ld/testsuite/ld-i386/pltgot-1.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-i386/pltgot-1.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-i386/pltgot-1.d 2023-03-09 14:51:52.553407178 +0100
|
||||||
|
@@ -2,6 +2,7 @@
|
||||||
|
#readelf: -S --wide
|
||||||
|
#as: --32
|
||||||
|
|
||||||
|
+#pass
|
||||||
|
#...
|
||||||
|
+\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-i386/pltgot-2.d binutils-2.40-new/ld/testsuite/ld-i386/pltgot-2.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-i386/pltgot-2.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-i386/pltgot-2.d 2023-03-09 14:51:52.554407167 +0100
|
||||||
|
@@ -3,7 +3,6 @@
|
||||||
|
#readelf: -d --wide
|
||||||
|
#as: --32
|
||||||
|
|
||||||
|
-#failif
|
||||||
|
#...
|
||||||
|
+0x[0-9a-f]+ +\(PLTREL.*
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.40-new/ld/testsuite/ld-i386/pr19636-2d.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-i386/pr19636-2d.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-i386/pr19636-2d.d 2023-03-09 14:51:52.554407167 +0100
|
||||||
|
@@ -8,7 +8,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 -rupN --no-dereference binutils-2.40/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.40-new/ld/testsuite/ld-i386/pr19636-2e.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-i386/pr19636-2e.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-i386/pr19636-2e.d 2023-03-09 14:51:52.554407167 +0100
|
||||||
|
@@ -8,7 +8,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 -rupN --no-dereference binutils-2.40/ld/testsuite/ld-i386/pr20830.d binutils-2.40-new/ld/testsuite/ld-i386/pr20830.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-i386/pr20830.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-i386/pr20830.d 2023-03-09 14:51:52.557407133 +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
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.40-new/ld/testsuite/ld-x86-64/pltgot-1.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-x86-64/pltgot-1.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-x86-64/pltgot-1.d 2023-03-09 14:51:52.555407156 +0100
|
||||||
|
@@ -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 -rupN --no-dereference binutils-2.40/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.40-new/ld/testsuite/ld-x86-64/pltgot-2.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-x86-64/pltgot-2.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-x86-64/pltgot-2.d 2023-03-09 14:51:52.555407156 +0100
|
||||||
|
@@ -3,7 +3,6 @@
|
||||||
|
#readelf: -d --wide
|
||||||
|
#as: --64
|
||||||
|
|
||||||
|
-#failif
|
||||||
|
#...
|
||||||
|
+0x[0-9a-f]+ +\(PLTREL.*
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.40-new/ld/testsuite/ld-x86-64/plt-main.rd
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-x86-64/plt-main.rd 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-x86-64/plt-main.rd 2023-03-09 14:51:52.555407156 +0100
|
||||||
|
@@ -1,4 +1,3 @@
|
||||||
|
-#failif
|
||||||
|
#...
|
||||||
|
[0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0
|
||||||
|
#...
|
||||||
|
diff -rupN --no-dereference binutils-2.40/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.40-new/ld/testsuite/ld-x86-64/pr20830a.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-x86-64/pr20830a.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-x86-64/pr20830a.d 2023-03-09 14:51:52.555407156 +0100
|
||||||
|
@@ -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 -rupN --no-dereference binutils-2.40/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.40-new/ld/testsuite/ld-x86-64/pr20830a-now.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-x86-64/pr20830a-now.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-x86-64/pr20830a-now.d 2023-03-09 14:51:52.555407156 +0100
|
||||||
|
@@ -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 -rupN --no-dereference binutils-2.40/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.40-new/ld/testsuite/ld-x86-64/pr20830b.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-x86-64/pr20830b.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-x86-64/pr20830b.d 2023-03-09 14:51:52.556407144 +0100
|
||||||
|
@@ -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 -rupN --no-dereference binutils-2.40/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.40-new/ld/testsuite/ld-x86-64/pr20830b-now.d
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-x86-64/pr20830b-now.d 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-x86-64/pr20830b-now.d 2023-03-09 14:51:52.556407144 +0100
|
||||||
|
@@ -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 -rupN --no-dereference binutils-2.40/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.40-new/ld/testsuite/ld-x86-64/tlspic2.rd
|
||||||
|
--- binutils-2.40/ld/testsuite/ld-x86-64/tlspic2.rd 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/ld/testsuite/ld-x86-64/tlspic2.rd 2023-03-09 14:51:52.556407144 +0100
|
||||||
|
@@ -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
|
@ -0,0 +1,28 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/bfd/elf.c binutils-2.40-new/bfd/elf.c
|
||||||
|
--- binutils-2.40/bfd/elf.c 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/bfd/elf.c 2023-03-09 14:51:57.453351322 +0100
|
||||||
|
@@ -825,7 +825,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'"),
|
||||||
|
@@ -933,7 +939,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
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,46 @@
|
|||||||
|
diff -rupN --no-dereference binutils-2.40/bfd/Makefile.am binutils-2.40-new/bfd/Makefile.am
|
||||||
|
--- binutils-2.40/bfd/Makefile.am 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/bfd/Makefile.am 2023-03-09 14:51:47.525462680 +0100
|
||||||
|
@@ -988,8 +988,8 @@ DISTCLEANFILES += $(BUILD_CFILES) $(BUIL
|
||||||
|
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 ;\
|
||||||
|
@@ -1000,7 +1000,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 -rupN --no-dereference binutils-2.40/bfd/Makefile.in binutils-2.40-new/bfd/Makefile.in
|
||||||
|
--- binutils-2.40/bfd/Makefile.in 2023-01-14 01:00:00.000000000 +0100
|
||||||
|
+++ binutils-2.40-new/bfd/Makefile.in 2023-03-09 14:51:47.526462669 +0100
|
||||||
|
@@ -2470,8 +2470,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 ;\
|
||||||
|
@@ -2482,7 +2482,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
|
Loading…
Reference in new issue