public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: binutils@sourceware.org
Subject: Commit: Update libiberty sources
Date: Sat, 03 Jul 2021 13:56:22 +0100	[thread overview]
Message-ID: <87h7hba749.fsf@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 109 bytes --]

Hi Guys,

  I am applying the attached file to synchronize our libiberty sources
  with gcc.

Cheers
  Nick


[-- Attachment #2: fred --]
[-- Type: application/octet-stream, Size: 31659 bytes --]

diff --git a/include/demangle.h b/include/demangle.h
index 23b47265d94..295d58cb454 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -408,6 +408,9 @@ enum demangle_component_type
      number which involves neither modifying the mangled string nor
      allocating a new copy of the literal in memory.  */
   DEMANGLE_COMPONENT_LITERAL_NEG,
+  /* A vendor's builtin expression.  The left subtree holds the
+     expression's name, and the right subtree is a argument list.  */
+  DEMANGLE_COMPONENT_VENDOR_EXPR,
   /* A libgcj compiled resource.  The left subtree is the name of the
      resource.  */
   DEMANGLE_COMPONENT_JAVA_RESOURCE,
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 70d7209bf0a..0143d429eb8 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,23 +1,82 @@
-2021-03-18  H.J. Lu  <hongjiu.lu@intel.com>
+2021-06-30  Gerald Pfeifer  <gerald@pfeifer.com>
 
-	PR binutils/27397
-	* configure: Regenerated.
+	* make-temp-file.c (usrtmp): Remove.
+	(choose_tmpdir): Remove use of usrtmp.
 
-2021-01-11  H.J. Lu  <hongjiu.lu@intel.com>
+2021-06-28  Indu Bhagat  <indu.bhagat@oracle.com>
 
-	PR ld/27173
-	* configure: Regenerated.
+	* simple-object.c (handle_lto_debug_sections): Copy over .BTF section.
+
+2021-06-28  Indu Bhagat  <indu.bhagat@oracle.com>
+	    David Faust  <david.faust@oracle.com>
+	    Jose E. Marchesi  <jose.marchesi@oracle.com>
+	    Weimin Pan  <weimin.pan@oracle.com>
+
+	* simple-object.c (handle_lto_debug_sections): Copy over .ctf
+	sections.
+
+2021-06-05  John David Anglin  <danglin@gcc.gnu.org>
+
+	PR target/100734
+	* configure.ac: Use libiberty snprintf and vsnprintf on
+	hppa*-*-hpux*.
+	* configure: Regenerate.
 
-2021-01-09  H.J. Lu  <hongjiu.lu@intel.com>
+2021-05-06  Tom Tromey  <tom@tromey.com>
 
-	* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
-	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
-	(configure_deps): Depend on ../config/gcc-plugin.m4.
-	* aclocal.m4: Include ../config/gcc-plugin.m4.
-	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
-	RANLIB_PLUGIN_OPTION.
+	* hashtab.c (htab_eq_string): New function.
+
+2021-05-04  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* configure.ac: Make test for variables more robust.
+	* configure: Regenerate.
+
+2021-05-03  H.J. Lu  <hjl.tools@gmail.com>
+
+	PR bootstrap/99703
 	* configure: Regenerated.
 
+2021-04-21  Andreas Schwab  <schwab@linux-m68k.org>
+
+	PR demangler/100177
+	* rust-demangle.c (demangle_const_char): Properly print the
+	character value.
+
+2021-03-31  Patrick Palka  <ppalka@redhat.com>
+
+	PR c++/88115
+	* cp-demangle.c (d_dump, d_make_comp, d_expression_1)
+	(d_count_templates_scopes): Handle DEMANGLE_COMPONENT_VENDOR_EXPR.
+	(d_print_comp_inner): Likewise.
+	<case DEMANGLE_COMPONENT_EXTENDED_OPERATOR>: Revert r11-4926
+	change.
+	<case DEMANGLE_COMPONENT_UNARY>: Likewise.
+	* testsuite/demangle-expected: Adjust __alignof__ tests.
+
+2021-03-16  Nick Clifton  <nickc@redhat.com>
+
+	* sha1.c (sha1_process_bytes): Use memmove in place of memcpy.
+
+2021-02-20  Mike Frysinger  <vapier@gentoo.org>
+
+	* Makefile.in (ACLOCAL, ACLOCAL_AMFLAGS, $(srcdir)/aclocal.m4): Define.
+	(configure_deps): Rename to ...
+	(aclocal_deps): ... this.  Replace aclocal.m4 with acinclude.m4.
+	($(srcdir)/configure): Replace $(configure_deps) with
+	$(srcdir)/aclocal.m4.
+	* aclocal.m4: Move libiberty macros to acinclude.m4, then regenerate.
+	* acinclude.m4: New file.
+	* configure: Regenerate.
+
+2021-02-19  Ayush Mittal  <ayush.m@samsung.com>
+
+	* argv.c (expandargv): free allocated buffer if read fails.
+
+2021-02-01  Martin Sebor  <msebor@redhat.com>
+
+	* dyn-string.c (dyn_string_insert_cstr): Use memcpy instead of strncpy
+	to avoid -Wstringop-truncation.
+
 2021-01-04  Martin Liska  <mliska@suse.cz>
 
 	* strverscmp.c: Convert to utf8 from iso8859.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 711e155b075..4f1213b983b 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -49,13 +49,13 @@ mkinstalldirs = $(SHELL) $(libiberty_topdir)/mkinstalldirs
 # Some compilers can't handle cc -c blah.c -o foo/blah.o.
 OUTPUT_OPTION = @OUTPUT_OPTION@
 
-AR = @AR@ @AR_PLUGIN_OPTION@
+AR = @AR@
 AR_FLAGS = rc
 
 CC = @CC@
 CFLAGS = @CFLAGS@
 CPPFLAGS = @CPPFLAGS@
-RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@
+RANLIB = @RANLIB@
 MAKEINFO = @MAKEINFO@
 PERL = @PERL@
 
@@ -481,19 +481,24 @@ config.status: $(srcdir)/configure
 	$(SHELL) ./config.status --recheck
 
 AUTOCONF = autoconf
-configure_deps = $(srcdir)/aclocal.m4 \
+ACLOCAL = aclocal
+ACLOCAL_AMFLAGS = -I ../config -I ..
+aclocal_deps = \
 	$(srcdir)/../config/acx.m4 \
 	$(srcdir)/../config/cet.m4 \
 	$(srcdir)/../config/enable.m4 \
-	$(srcdir)/../config/gcc-plugin.m4 \
 	$(srcdir)/../config/no-executables.m4 \
 	$(srcdir)/../config/override.m4 \
 	$(srcdir)/../config/picflag.m4 \
-	$(srcdir)/../config/warnings.m4
+	$(srcdir)/../config/warnings.m4 \
+	$(srcdir)/acinclude.m4
 
-$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(configure_deps)
+$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4
 	cd $(srcdir) && $(AUTOCONF)
 
+$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
 # Depending on config.h makes sure that config.status has been re-run
 # if needed.  This prevents problems with parallel builds, in case
 # subdirectories need to run config.status also.
diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
index b2e54d9e32a..3378316dced 100644
--- a/libiberty/aclocal.m4
+++ b/libiberty/aclocal.m4
@@ -1,178 +1,21 @@
-sinclude(../config/acx.m4)
-sinclude(../config/cet.m4)
-sinclude(../config/enable.m4)
-sinclude(../config/gcc-plugin.m4)
-sinclude(../config/no-executables.m4)
-sinclude(../config/override.m4)
-sinclude(../config/picflag.m4)
-sinclude(../config/warnings.m4)
-
-dnl See whether strncmp reads past the end of its string parameters.
-dnl On some versions of SunOS4 at least, strncmp reads a word at a time
-dnl but erroneously reads past the end of strings.  This can cause
-dnl a SEGV in some cases.
-AC_DEFUN(libiberty_AC_FUNC_STRNCMP,
-[AC_REQUIRE([AC_FUNC_MMAP])
-AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works,
-[AC_TRY_RUN([
-/* Test by Jim Wilson and Kaveh Ghazi.
-   Check whether strncmp reads past the end of its string parameters. */
-#include <sys/types.h>
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
-#ifndef MAP_ANON
-#ifdef MAP_ANONYMOUS
-#define MAP_ANON MAP_ANONYMOUS
-#else
-#define MAP_ANON MAP_FILE
-#endif
-#endif
-
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
-#define MAP_LEN 0x10000
-
-main ()
-{
-#if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE)
-  char *p;
-  int dev_zero;
-
-  dev_zero = open ("/dev/zero", O_RDONLY);
-  if (dev_zero < 0)
-    exit (1);
-  
-  p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
-		     MAP_ANON|MAP_PRIVATE, dev_zero, 0);
-  if (p == (char *)-1)
-    p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
-		       MAP_ANON|MAP_PRIVATE, -1, 0);
-  if (p == (char *)-1)
-    exit (2);
-  else
-    {
-      char *string = "__si_type_info";
-      char *q = (char *) p + MAP_LEN - strlen (string) - 2;
-      char *r = (char *) p + 0xe;
-
-      strcpy (q, string);
-      strcpy (r, string);
-      strncmp (r, q, 14);
-    }
-#endif /* HAVE_MMAP || HAVE_MMAP_ANYWHERE */
-  exit (0);
-}
-], ac_cv_func_strncmp_works=yes, ac_cv_func_strncmp_works=no,
-  ac_cv_func_strncmp_works=yes)
-rm -f core core.* *.core])
-if test $ac_cv_func_strncmp_works = no ; then
-  AC_LIBOBJ([strncmp])
-fi
-])
-
-dnl See if errno must be declared even when <errno.h> is included.
-AC_DEFUN(libiberty_AC_DECLARE_ERRNO,
-[AC_CACHE_CHECK(whether errno must be declared, libiberty_cv_declare_errno,
-[AC_TRY_COMPILE(
-[#include <errno.h>],
-[int x = errno;],
-libiberty_cv_declare_errno=no,
-libiberty_cv_declare_errno=yes)])
-if test $libiberty_cv_declare_errno = yes
-then AC_DEFINE(NEED_DECLARATION_ERRNO, 1,
-  [Define if errno must be declared even when <errno.h> is included.])
-fi
-])
-
-dnl See whether we need a declaration for a function.
-AC_DEFUN(libiberty_NEED_DECLARATION,
-[AC_MSG_CHECKING([whether $1 must be declared])
-AC_CACHE_VAL(libiberty_cv_decl_needed_$1,
-[AC_TRY_COMPILE([
-#include "confdefs.h"
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif],
-[char *(*pfn) = (char *(*)) $1],
-libiberty_cv_decl_needed_$1=no, libiberty_cv_decl_needed_$1=yes)])
-AC_MSG_RESULT($libiberty_cv_decl_needed_$1)
-if test $libiberty_cv_decl_needed_$1 = yes; then
-  AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
-            [Define if $1 is not declared in system header files.])
-fi
-])dnl
-
-# We always want a C version of alloca() compiled into libiberty,
-# because native-compiler support for the real alloca is so !@#$%
-# unreliable that GCC has decided to use it only when being compiled
-# by GCC.  This is the part of AC_FUNC_ALLOCA that calculates the
-# information alloca.c needs.
-AC_DEFUN(libiberty_AC_FUNC_C_ALLOCA,
-[AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray,
-[AC_EGREP_CPP(webecray,
-[#if defined(CRAY) && ! defined(CRAY2)
-webecray
-#else
-wenotbecray
-#endif
-], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    AC_CHECK_FUNC($ac_func, 
-      [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func, 
-  [Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP
-   systems. This function is required for alloca.c support on those
-   systems.])  break])
-  done
-fi
-
-AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
-[AC_TRY_RUN([find_stack_direction ()
-{
-  static char *addr = 0;
-  auto char dummy;
-  if (addr == 0)
-    {
-      addr = &dummy;
-      return find_stack_direction ();
-    }
-  else
-    return (&dummy > addr) ? 1 : -1;
-}
-main ()
-{
-  exit (find_stack_direction() < 0);
-}], 
-  ac_cv_c_stack_direction=1,
-  ac_cv_c_stack_direction=-1,
-  ac_cv_c_stack_direction=0)])
-AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction,
-  [Define if you know the direction of stack growth for your system;
-   otherwise it will be automatically deduced at run-time.
-        STACK_DIRECTION > 0 => grows toward higher addresses
-        STACK_DIRECTION < 0 => grows toward lower addresses
-        STACK_DIRECTION = 0 => direction of growth unknown])
-])
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+
+# This file 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, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_include([../config/acx.m4])
+m4_include([../config/cet.m4])
+m4_include([../config/enable.m4])
+m4_include([../config/no-executables.m4])
+m4_include([../config/picflag.m4])
+m4_include([../config/warnings.m4])
+m4_include([acinclude.m4])
diff --git a/libiberty/argv.c b/libiberty/argv.c
index cd97f9071c2..48dcd102461 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -442,7 +442,10 @@ expandargv (int *argcp, char ***argvp)
 	     due to CR/LF->CR translation when reading text files.
 	     That does not in-and-of itself indicate failure.  */
 	  && ferror (f))
-	goto error;
+	{
+	  free (buffer);
+	  goto error;
+	}
       /* Add a NUL terminator.  */
       buffer[len] = '\0';
       /* If the file is empty or contains only whitespace, buildargv would
diff --git a/libiberty/configure b/libiberty/configure
index 29a690d44fc..f7449d6a368 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -645,8 +645,6 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
-RANLIB_PLUGIN_OPTION
-AR_PLUGIN_OPTION
 RANLIB
 AR
 host_os
@@ -683,6 +681,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -762,6 +761,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1014,6 +1014,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1151,7 +1160,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1304,6 +1313,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -2460,9 +2470,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-
-
-
 # This works around the fact that libtool configuration may change LD
 # for this particular configuration, but some shells, instead of
 # keeping the changes in LD private, export them just because LD is
@@ -2934,144 +2941,6 @@ else
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AR="${ac_tool_prefix}ar"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_AR="ar"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_AR" = x; then
-    AR=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AR=$ac_ct_AR
-  fi
-else
-  AR="$ac_cv_prog_AR"
-fi
-
-if test "${AR}" = "" ; then
-  as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  PLUGIN_OPTION="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-if test -n "$PLUGIN_OPTION"; then
-  if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR_PLUGIN_OPTION="$PLUGIN_OPTION"
-
-  fi
-  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
-    RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
-
-  fi
-fi
-
 # Add --enable-multilib to configure.
 # Default to --enable-multilib
 # Check whether --enable-multilib was given.
@@ -4426,7 +4295,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -4472,7 +4341,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -4496,7 +4365,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -4541,7 +4410,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -4565,7 +4434,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -6731,6 +6600,22 @@ if test -z "${setobjs}"; then
     ac_cv_func_getpagesize=yes
     ;;
 
+  hppa*-*-hpux*)
+    # Replace system snprintf and vsnprintf with libiberty implementations.
+    case " $LIBOBJS " in
+  *" snprintf.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
+ ;;
+esac
+
+    case " $LIBOBJS " in
+  *" vsnprintf.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS vsnprintf.$ac_objext"
+ ;;
+esac
+
+    ;;
+
   *-*-mingw32*)
     # Under mingw32, sys_nerr and sys_errlist exist, but they are
     # macros, so the test below won't find them.
@@ -7192,11 +7077,11 @@ else
 fi
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-int *p;
+extern int $v [];
 int
 main ()
 {
-extern int $v []; p = $v;
+if ($v [0]) return 1;
   ;
   return 0;
 }
@@ -7690,6 +7575,8 @@ main ()
     if (*(data + i) != *(data3 + i))
       return 14;
   close (fd);
+  free (data);
+  free (data3);
   return 0;
 }
 _ACEOF
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 756d11a8260..a85ff25501a 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -108,18 +108,6 @@ dnl to call AC_CHECK_PROG.
 AC_CHECK_TOOL(AR, ar)
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 
-GCC_PLUGIN_OPTION(PLUGIN_OPTION)
-if test -n "$PLUGIN_OPTION"; then
-  if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR_PLUGIN_OPTION="$PLUGIN_OPTION"
-    AC_SUBST(AR_PLUGIN_OPTION)
-  fi
-  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
-    RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
-    AC_SUBST(RANLIB_PLUGIN_OPTION)
-  fi
-fi
-
 dnl When switching to automake, replace the following with AM_ENABLE_MULTILIB.
 # Add --enable-multilib to configure.
 # Default to --enable-multilib
@@ -623,6 +611,12 @@ if test -z "${setobjs}"; then
     ac_cv_func_getpagesize=yes
     ;;
 
+  hppa*-*-hpux*)
+    # Replace system snprintf and vsnprintf with libiberty implementations.
+    AC_LIBOBJ([snprintf])
+    AC_LIBOBJ([vsnprintf])
+    ;;
+
   *-*-mingw32*)
     # Under mingw32, sys_nerr and sys_errlist exist, but they are
     # macros, so the test below won't find them.
@@ -677,7 +671,7 @@ if test -z "${setobjs}"; then
   for v in $vars; do
     AC_MSG_CHECKING([for $v])
     AC_CACHE_VAL(libiberty_cv_var_$v,
-      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])],
+      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int $v [];]],[[if ($v [0]) return 1;]])],
 		      [eval "libiberty_cv_var_$v=yes"],
 		      [eval "libiberty_cv_var_$v=no"])])
     if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index d3e798455cc..33490f60285 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -815,6 +815,9 @@ d_dump (struct demangle_component *dc, int indent)
     case DEMANGLE_COMPONENT_LITERAL_NEG:
       printf ("negative literal\n");
       break;
+    case DEMANGLE_COMPONENT_VENDOR_EXPR:
+      printf ("vendor expression\n");
+      break;
     case DEMANGLE_COMPONENT_JAVA_RESOURCE:
       printf ("java resource\n");
       break;
@@ -976,6 +979,7 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
     case DEMANGLE_COMPONENT_TRINARY_ARG1:
     case DEMANGLE_COMPONENT_LITERAL:
     case DEMANGLE_COMPONENT_LITERAL_NEG:
+    case DEMANGLE_COMPONENT_VENDOR_EXPR:
     case DEMANGLE_COMPONENT_COMPOUND_NAME:
     case DEMANGLE_COMPONENT_VECTOR_TYPE:
     case DEMANGLE_COMPONENT_CLONE:
@@ -3344,6 +3348,7 @@ d_unresolved_name (struct d_info *di)
 		::= cl <expression>+ E
                 ::= st <type>
                 ::= <template-param>
+		::= u <source-name> <template-arg>* E # vendor extended expression
 		::= <unresolved-name>
                 ::= <expr-primary>
 
@@ -3425,6 +3430,15 @@ d_expression_1 (struct d_info *di)
       return d_make_comp (di, DEMANGLE_COMPONENT_INITIALIZER_LIST,
 			  type, d_exprlist (di, 'E'));
     }
+  else if (peek == 'u')
+    {
+      /* A vendor extended expression.  */
+      struct demangle_component *name, *args;
+      d_advance (di, 1);
+      name = d_source_name (di);
+      args = d_template_args_1 (di);
+      return d_make_comp (di, DEMANGLE_COMPONENT_VENDOR_EXPR, name, args);
+    }
   else
     {
       struct demangle_component *op;
@@ -4229,6 +4243,7 @@ d_count_templates_scopes (struct d_print_info *dpi,
     case DEMANGLE_COMPONENT_TRINARY_ARG2:
     case DEMANGLE_COMPONENT_LITERAL:
     case DEMANGLE_COMPONENT_LITERAL_NEG:
+    case DEMANGLE_COMPONENT_VENDOR_EXPR:
     case DEMANGLE_COMPONENT_JAVA_RESOURCE:
     case DEMANGLE_COMPONENT_COMPOUND_NAME:
     case DEMANGLE_COMPONENT_DECLTYPE:
@@ -5509,18 +5524,9 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
       }
 
     case DEMANGLE_COMPONENT_EXTENDED_OPERATOR:
-      {
-	struct demangle_component *name = dc->u.s_extended_operator.name;
-	if (name->type == DEMANGLE_COMPONENT_NAME
-	    && !strncmp (name->u.s_name.s, "__alignof__", name->u.s_name.len))
-	  d_print_comp (dpi, options, dc->u.s_extended_operator.name);
-	else
-	  {
-	    d_append_string (dpi, "operator ");
-	    d_print_comp (dpi, options, dc->u.s_extended_operator.name);
-	  }
-	return;
-      }
+      d_append_string (dpi, "operator ");
+      d_print_comp (dpi, options, dc->u.s_extended_operator.name);
+      return;
 
     case DEMANGLE_COMPONENT_CONVERSION:
       d_append_string (dpi, "operator ");
@@ -5585,14 +5591,8 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
 	if (code && !strcmp (code, "gs"))
 	  /* Avoid parens after '::'.  */
 	  d_print_comp (dpi, options, operand);
-	else if ((code && !strcmp (code, "st"))
-		 || (op->type == DEMANGLE_COMPONENT_EXTENDED_OPERATOR
-		     && (op->u.s_extended_operator.name->type
-			 == DEMANGLE_COMPONENT_NAME)
-		     && !strncmp (op->u.s_extended_operator.name->u.s_name.s,
-				  "__alignof__",
-				  op->u.s_extended_operator.name->u.s_name.len)))
-	  /* Always print parens for sizeof (type) and __alignof__.  */
+	else if (code && !strcmp (code, "st"))
+	  /* Always print parens for sizeof (type).  */
 	  {
 	    d_append_char (dpi, '(');
 	    d_print_comp (dpi, options, operand);
@@ -5805,6 +5805,13 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
       }
       return;
 
+    case DEMANGLE_COMPONENT_VENDOR_EXPR:
+      d_print_comp (dpi, options, d_left (dc));
+      d_append_char (dpi, '(');
+      d_print_comp (dpi, options, d_right (dc));
+      d_append_char (dpi, ')');
+      return;
+
     case DEMANGLE_COMPONENT_NUMBER:
       d_append_num (dpi, dc->u.s_number.number);
       return;
diff --git a/libiberty/dyn-string.c b/libiberty/dyn-string.c
index ea711182ca5..8d2456b86c8 100644
--- a/libiberty/dyn-string.c
+++ b/libiberty/dyn-string.c
@@ -277,7 +277,7 @@ dyn_string_insert_cstr (dyn_string_t dest, int pos, const char *src)
   for (i = dest->length; i >= pos; --i)
     dest->s[i + length] = dest->s[i];
   /* Splice in the new stuff.  */
-  strncpy (dest->s + pos, src, length);
+  memcpy (dest->s + pos, src, length);
   /* Compute the new length.  */
   dest->length += length;
   return 1;
diff --git a/libiberty/make-temp-file.c b/libiberty/make-temp-file.c
index 7465cec5ea6..31f87fbcfde 100644
--- a/libiberty/make-temp-file.c
+++ b/libiberty/make-temp-file.c
@@ -81,8 +81,6 @@ try_dir (const char *dir, const char *base)
 }
 
 static const char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 };
-static const char usrtmp[] =
-{ DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
 static const char vartmp[] =
 { DIR_SEPARATOR, 'v', 'a', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
 
@@ -129,9 +127,8 @@ choose_tmpdir (void)
 	base = try_dir (P_tmpdir, base);
 #endif
 
-      /* Try /var/tmp, /usr/tmp, then /tmp.  */
+      /* Try /var/tmp, then /tmp.  */
       base = try_dir (vartmp, base);
-      base = try_dir (usrtmp, base);
       base = try_dir (tmp, base);
       
       /* If all else fails, use the current directory!  */
diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c
index 6fd8f6a4db0..449941b56dc 100644
--- a/libiberty/rust-demangle.c
+++ b/libiberty/rust-demangle.c
@@ -1253,9 +1253,12 @@ demangle_const_char (struct rust_demangler *rdm)
   else if (value == '\n')
     PRINT ("\\n");
   else if (value > ' ' && value < '~')
-    /* Rust also considers many non-ASCII codepoints to be printable, but
-       that logic is not easily ported to C. */
-    print_str (rdm, (char *) &value, 1);
+    {
+      /* Rust also considers many non-ASCII codepoints to be printable, but
+	 that logic is not easily ported to C. */
+      char c = value;
+      print_str (rdm, &c, 1);
+    }
   else
     {
       PRINT ("\\u{");
diff --git a/libiberty/sha1.c b/libiberty/sha1.c
index e3d7f86e351..7d15d48d11d 100644
--- a/libiberty/sha1.c
+++ b/libiberty/sha1.c
@@ -258,7 +258,7 @@ sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
 	{
 	  sha1_process_block (ctx->buffer, 64, ctx);
 	  left_over -= 64;
-	  memcpy (ctx->buffer, &ctx->buffer[16], left_over);
+	  memmove (ctx->buffer, &ctx->buffer[16], left_over);
 	}
       ctx->buflen = left_over;
     }
diff --git a/libiberty/simple-object.c b/libiberty/simple-object.c
index 6d70b95a00b..facbf94fd09 100644
--- a/libiberty/simple-object.c
+++ b/libiberty/simple-object.c
@@ -304,6 +304,12 @@ handle_lto_debug_sections (const char *name, int rename)
   /* Copy over .GCC.command.line section under the same name if present.  */
   else if (strcmp (name, ".GCC.command.line") == 0)
     return strcpy (newname, name);
+  /* Copy over .ctf section under the same name if present.  */
+  else if (strcmp (name, ".ctf") == 0)
+    return strcpy (newname, name);
+  /* Copy over .BTF section under the same name if present.  */
+  else if (strcmp (name, ".BTF") == 0)
+    return strcpy (newname, name);
   free (newname);
   return NULL;
 }
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index e6b5b64b9a9..19a0d621bc0 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -1471,10 +1471,10 @@ _Z2F2IZ1FvEUlvE_EN1AIT_E1XES2_
 A<F()::{lambda()#1}>::X F2<F()::{lambda()#1}>(F()::{lambda()#1})
 
 # PR 88115
-_Z1fIiEvDTv111__alignof__T_E
+_Z1fIiEvDTu11__alignof__T_EE
 void f<int>(decltype (__alignof__(int)))
 
-_Z1fIiEvDTv111__alignof__tlT_EE
+_Z1fIiEvDTu11__alignof__XtlT_EEEE
 void f<int>(decltype (__alignof__(int{})))
 
 _Z1gI1AEv1SIXadsrT_oncviEE

             reply	other threads:[~2021-07-03 12:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03 12:56 Nick Clifton [this message]
2021-07-04 12:56 ` Alan Modra
2021-07-04 13:54   ` H.J. Lu
2021-07-05 15:25     ` Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
2023-06-26 14:46 Nick Clifton
2018-01-10 13:59 Nick Clifton
2018-01-15 16:03 ` Szabolcs Nagy
2018-01-15 16:08   ` H.J. Lu
2017-09-01  9:59 Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7hba749.fsf@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).