Unverified Commit 8329438e authored by Sergei Trofimovich's avatar Sergei Trofimovich Committed by GitHub
Browse files

Merge pull request #187972 from trofi/binutils-2.38-holdback

Create binutils 2.38 holdback set of releases
parents 83874827 7fe41f92
Loading
Loading
Loading
Loading
+137 −0
Original line number Diff line number Diff line
From beca4a2c25ee86e4020f8b8bddc4d8e0ed3430b3 Mon Sep 17 00:00:00 2001
From: Andrew Childs <andrew.childs@bibo.com.ph>
Date: Tue, 22 Feb 2022 11:28:04 +0900
Subject: [PATCH] Revert "libtool.m4: fix nm BSD flag detection"

This reverts commit bef9ef8ca0f941d743c77cc55b5fe7985990b2a7.
---
 ChangeLog  |  9 ------
 libtool.m4 | 88 ++++++++++++++++++++++++++----------------------------
 2 files changed, 43 insertions(+), 54 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 18e8b6835da..c12f07403c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -375,15 +375,6 @@
 
 	* src-release.sh (GDB_SUPPPORT_DIRS): Add libbacktrace.
 
-2021-09-27  Nick Alcock  <nick.alcock@oracle.com>
-
-	PR libctf/27967
-	* libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
-	NM, if there is one.  Run nm on itself, not on /dev/null, to avoid
-	errors from nms that refuse to work on non-regular files.  Remove
-	other workarounds for this problem.  Strip out blank lines from the
-	nm output.
-
 2021-09-27  Nick Alcock  <nick.alcock@oracle.com>
 
 	PR libctf/27967
diff --git a/libtool.m4 b/libtool.m4
index a216bb14e99..7a711249304 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -3200,55 +3200,53 @@ _LT_DECL([], [file_magic_cmd], [1],
 
 # LT_PATH_NM
 # ----------
-# find the pathname to a BSD- or MS-compatible name lister, and any flags
-# needed to make it compatible
+# find the pathname to a BSD- or MS-compatible name lister
 AC_DEFUN([LT_PATH_NM],
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
 [if test -n "$NM"; then
-   # Let the user override the nm to test.
-   lt_nm_to_check="$NM"
- else
-   lt_nm_to_check="${ac_tool_prefix}nm"
-   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-     lt_nm_to_check="$lt_nm_to_check nm"
-   fi
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
-   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-     IFS="$lt_save_ifs"
-     test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
-     */*|*\\*) tmp_nm="$lt_tmp_nm";;
-     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
-     esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-       # Check to see if the nm accepts a BSD-compat flag.
-       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-       #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
-       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
-	 break
-	 ;;
-       *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
-	 *$tmp_nm*)
-	   lt_cv_path_NM="$tmp_nm -p"
-	   break
-	   ;;
-	 *)
-	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	   continue # so that we can try to find one that supports BSD flags
-	   ;;
-	 esac
-	 ;;
-       esac
-     fi
-   done
-   IFS="$lt_save_ifs"
- done
- : ${lt_cv_path_NM=no}])
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
 if test "$lt_cv_path_NM" != "no"; then
   NM="$lt_cv_path_NM"
 else
-- 
2.34.1
+47 −0
Original line number Diff line number Diff line
From 33a8dc728eb5da3e1d3439c96810d1f6b2660b89 Mon Sep 17 00:00:00 2001
From: Andrew Childs <andrew.childs@bibo.com.ph>
Date: Tue, 22 Feb 2022 12:24:46 +0900
Subject: [PATCH] libtool.m4: update macos version detection block

Includes upstream change
9e8c882517082fe5755f2524d23efb02f1522490
---
 libtool.m4 | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/libtool.m4 b/libtool.m4
index 7a711249304..f452efb4300 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -996,20 +996,15 @@ _LT_EOF
     ])
     case $host_os in
     rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[[012]][[,.]]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+    darwin*)
+      case $MACOSX_DEPLOYMENT_TARGET,$host in
+        10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
+          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+        *)
+          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-- 
2.34.1
+29 −0
Original line number Diff line number Diff line
@@ -, +, @@ 
---
 bfd/elf32-arm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--- a/bfd/elf32-arm.c	
+++ a/bfd/elf32-arm.c	
@@ -15398,7 +15398,11 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
      linker to copy the initial value out of the dynamic object and into
      the runtime process image.  We need to remember the offset into the
      .rel(a).bss section we are going to use.  */
-  if ((h->root.u.def.section->flags & SEC_READONLY) != 0)
+  if (info->nocopyreloc == 0
+      && (h->root.u.def.section->flags & SEC_ALLOC) != 0
+      /* PR 16177: A copy is only needed if the input section is readonly.  */
+      && (h->root.u.def.section->flags & SEC_READONLY) != 0
+      && h->size != 0)
     {
       s = globals->root.sdynrelro;
       srel = globals->root.sreldynrelro;
@@ -15410,6 +15414,8 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
     }
   if (info->nocopyreloc == 0
       && (h->root.u.def.section->flags & SEC_ALLOC) != 0
+      /* PR 16177: A copy is only needed if the input section is readonly.  */
+      && (h->root.u.def.section->flags & SEC_READONLY) != 0
       && h->size != 0)
     {
       elf32_arm_allocate_dynrelocs (info, srel, 1);
+14 −0
Original line number Diff line number Diff line
diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index b6940d376d..0feb1adfd0 100755
--- a/ld/genscripts.sh
+++ b/ld/genscripts.sh
@@ -125,6 +125,9 @@ if test "x$NATIVE" = "xyes" ; then
   USE_LIBPATH=yes
 fi
 
+# TODO: why is this needed?
+USE_LIBPATH=yes
+
 # Set the library search path, for libraries named by -lfoo.
 # If LIB_PATH is defined (e.g., by Makefile) and non-empty, it is used.
 # Otherwise, the default is set here.
+155 −0
Original line number Diff line number Diff line
diff --git a/bfd/configure.ac b/bfd/configure.ac
index fec067b2135..377e1f5443f 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -292,30 +292,16 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
 
 LT_LIB_M
 
-# When building a shared libbfd, link against the pic version of libiberty
-# so that apps that use libbfd won't need libiberty just to satisfy any
-# libbfd references.
-# We can't do that if a pic libiberty is unavailable since including non-pic
-# code would insert text relocations into libbfd.
 SHARED_LIBADD=
-SHARED_LDFLAGS=
+SHARED_LDFLAGS=-liberty
 if test "$enable_shared" = "yes"; then
-changequote(,)dnl
-  x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
-changequote([,])dnl
-  if test -n "$x"; then
-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
-  fi
-fi
-
 SHARED_LIBADD="$SHARED_LIBADD $LIBINTL"
 
-if test "$enable_shared" = "yes"; then
   case "${host}" in
   # More hacks to build DLLs on Windows.
   *-*-cygwin*)
     SHARED_LDFLAGS="-no-undefined"
-    SHARED_LIBADD="-L`pwd`/../libiberty -liberty $SHARED_LIBADD -lcygwin -lkernel32"
+    SHARED_LIBADD="-liberty $SHARED_LIBADD -lcygwin -lkernel32"
   ;;
   esac
 
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index 0e04b4c05c4..848a02662e7 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -51,7 +51,7 @@ libopcodes_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
 endif
 
 # This is where bfd.h lives.
-BFD_H = ../bfd/bfd.h
+BFD_H = $(BFDDIR)/bfd.h
 
 BUILD_LIBS = @BUILD_LIBS@
 BUILD_LIB_DEPS = @BUILD_LIB_DEPS@
@@ -303,7 +303,7 @@ OFILES = @BFD_MACHINES@
 # development.sh is used to determine -Werror default.
 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
 
-AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
+AM_CPPFLAGS = -I. -I$(srcdir) -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
 
 disassemble.lo: disassemble.c
 if am__fastdepCC
@@ -327,9 +327,18 @@ libopcodes_la_SOURCES =  dis-buf.c disassemble.c dis-init.c
-libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@
+libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@ libtool-soversion
 libopcodes_la_LIBADD = $(OFILES) @SHARED_LIBADD@
-libopcodes_la_LDFLAGS += -release `cat ../bfd/libtool-soversion` @SHARED_LDFLAGS@
+libopcodes_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@
 # Allow dependency tracking to work on all the source files.
 EXTRA_libopcodes_la_SOURCES = $(LIBOPCODES_CFILES)
 
+libtool-soversion:
+	@echo "creating $@"
+	bfd_soversion="$(VERSION)" ;\
+	. $(BFDDIR)/development.sh ;\
+	if test "$$development" = true ; then \
+	  bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
+	fi ;\
+	echo "$${bfd_soversion}" > $@
+
 # libtool will build .libs/libopcodes.a.  We create libopcodes.a in
 # the build directory so that we don't have to convert all the
 # programs that use libopcodes.a simultaneously.  This is a hack which
diff --git a/opcodes/configure.ac b/opcodes/configure.ac
index e564f067334..5da62a3d58b 100644
--- a/opcodes/configure.ac
+++ b/opcodes/configure.ac
@@ -98,6 +98,8 @@ BFD_64_BIT
 AC_SUBST(HDEFINES)
 AC_PROG_INSTALL
 
+GCC_HEADER_STDINT(bfd_stdint.h)
+
 AC_CHECK_DECLS([basename, stpcpy])
 
 # Check if sigsetjmp is available.  Using AC_CHECK_FUNCS won't do
@@ -148,44 +150,21 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
 
 LT_LIB_M
 
-#Libs for generator progs
-if test "x$cross_compiling" = "xno"; then
-  BUILD_LIBS=../libiberty/libiberty.a
-  BUILD_LIB_DEPS=$BUILD_LIBS
-else
-  # if cross-compiling, assume that the system provides -liberty
-  # and that the version is compatible with new headers.
-  BUILD_LIBS=-liberty
-  BUILD_LIB_DEPS=
-fi
-BUILD_LIBS="$BUILD_LIBS $LIBINTL"
-BUILD_LIB_DEPS="$BUILD_LIB_DEPS $LIBINTL_DEP"
+BUILD_LIBS="-liberty $LIBINTL"
+BUILD_LIB_DEPS="$LIBINTL_DEP"
 
 AC_SUBST(BUILD_LIBS)
 AC_SUBST(BUILD_LIB_DEPS)
 
 # Horrible hacks to build DLLs on Windows and a shared library elsewhere.
 SHARED_LDFLAGS=
-SHARED_LIBADD=
+SHARED_LIBADD=-liberty
 SHARED_DEPENDENCIES=
-if test "$enable_shared" = "yes"; then
-# When building a shared libopcodes, link against the pic version of libiberty
-# so that apps that use libopcodes won't need libiberty just to satisfy any
-# libopcodes references.
-# We can't do that if a pic libiberty is unavailable since including non-pic
-# code would insert text relocations into libopcodes.
 # Note that linking against libbfd as we do here, which is itself linked
 # against libiberty, may not satisfy all the libopcodes libiberty references
 # since libbfd may not pull in the entirety of libiberty.
 # Also, jam libintl into the right place in all of this: after libiberty,
 # which uses it, but before -lcygwin, which it uses.
-changequote(,)dnl
-  x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
-changequote([,])dnl
-  if test -n "$x"; then
-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
-  fi
-fi
 
 SHARED_LIBADD="$SHARED_LIBADD $LIBINTL"
 
@@ -193,11 +172,10 @@ if test "$enable_shared" = "yes"; then
   case "${host}" in
     *-*-cygwin*)
       SHARED_LDFLAGS="-no-undefined"
-      SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD"
+      SHARED_LIBADD="-lbfd -liberty $SHARED_LIBADD"
       ;;
     *)
-      SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}"
-      SHARED_DEPENDENCIES="../bfd/libbfd.la"
+      SHARED_LIBADD="-lbfd ${SHARED_LIBADD}"
       ;;
   esac
 
Loading