public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Commit: Update libiberty sources
@ 2023-06-26 14:46 Nick Clifton
  0 siblings, 0 replies; 9+ messages in thread
From: Nick Clifton @ 2023-06-26 14:46 UTC (permalink / raw)
  To: binutils

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

Hi Guys,

  I am applying the attached patch to synchronize the libiberty sources
  with the master version in the gcc repository.

Cheers
  Nick

libiberty/ChangeLog
2023-06-15  Marek Polacek  <polacek@redhat.com>

	* configure.ac: Also set shared when enable_host_pie.
	* configure: Regenerate.

2023-06-13  Nathan Sidwell  <nathan@acm.org>

	* cp-demangle.c (d_print_conversion): Remove incorrect
	template instantiation handling.
	* testsuite/demangle-expected: Add testcases.

2023-06-07  Costas Argyris  <costas.argyris@gmail.com>

	* argv.c (writeargv): Constant propagate "0" for "status",
	simplifying the code slightly.

2023-06-06  Costas Argyris  <costas.argyris@gmail.com>

	* argv.c (writeargv): Simplify & remove gotos.

2023-06-05  Costas Argyris  <costas.argyris@gmail.com>

	* pex-win32.c: fix typos.

2023-06-05  Costas Argyris  <costas.argyris@gmail.com>

	* pex-win32.c (win32_spawn): Check command line length
	and generate a response file if necessary.
	(spawn_script): Adjust parameters.
	(pex_win32_exec_child): Ditto.

2023-06-03  Patrick Palka  <ppalka@redhat.com>

	PR c++/70790
	* cp-demangle.c (cplus_demangle_operators): Add the noexcept
	operator.
	(d_print_comp_inner) <case DEMANGLE_COMPONENT_UNARY>: Always
	print parens around the operand of noexcept too.
	* testsuite/demangle-expected: Test noexcept operator
	demangling.

2023-04-02  Jakub Jelinek  <jakub@redhat.com>

	PR other/109306
	* strstr.c: Revert the 2020-11-13 changes.
	(strstr): Return s1 if len is 0.

2023-03-30  Gerald Pfeifer  <gerald@pfeifer.com>

	* obstacks.texi (Preparing for Obstacks): Remove a (broken)
	reference to the Glibc manual.

2023-03-03  Costas Argyris  <costas.argyris@gmail.com>

	* pex-win32.c (win32_spawn): Fix memory leak of cmdline
	buffer and refactor to have cleanup code appear once
	for all exit cases.

2023-02-11  niXman  <i.nixman@autistici.org>

	* lrealpath.c (lrealpath): try to resolve symlink and
	use UNC paths where applicable.

2023-01-07  LIU Hao  <lh_mouse@126.com>

	PR middle-end/108300
	* make-temp-file.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.
	* pex-win32.c: Likewise.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libiberty.patch --]
[-- Type: text/x-patch, Size: 22908 bytes --]

diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 0e2289d81b7..3424fef99ba 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,72 @@
+2023-06-15  Marek Polacek  <polacek@redhat.com>
+
+	* configure.ac: Also set shared when enable_host_pie.
+	* configure: Regenerate.
+
+2023-06-13  Nathan Sidwell  <nathan@acm.org>
+
+	* cp-demangle.c (d_print_conversion): Remove incorrect
+	template instantiation handling.
+	* testsuite/demangle-expected: Add testcases.
+
+2023-06-07  Costas Argyris  <costas.argyris@gmail.com>
+
+	* argv.c (writeargv): Constant propagate "0" for "status",
+	simplifying the code slightly.
+
+2023-06-06  Costas Argyris  <costas.argyris@gmail.com>
+
+	* argv.c (writeargv): Simplify & remove gotos.
+
+2023-06-05  Costas Argyris  <costas.argyris@gmail.com>
+
+	* pex-win32.c: fix typos.
+
+2023-06-05  Costas Argyris  <costas.argyris@gmail.com>
+
+	* pex-win32.c (win32_spawn): Check command line length
+	and generate a response file if necessary.
+	(spawn_script): Adjust parameters.
+	(pex_win32_exec_child): Ditto.
+
+2023-06-03  Patrick Palka  <ppalka@redhat.com>
+
+	PR c++/70790
+	* cp-demangle.c (cplus_demangle_operators): Add the noexcept
+	operator.
+	(d_print_comp_inner) <case DEMANGLE_COMPONENT_UNARY>: Always
+	print parens around the operand of noexcept too.
+	* testsuite/demangle-expected: Test noexcept operator
+	demangling.
+
+2023-04-02  Jakub Jelinek  <jakub@redhat.com>
+
+	PR other/109306
+	* strstr.c: Revert the 2020-11-13 changes.
+	(strstr): Return s1 if len is 0.
+
+2023-03-30  Gerald Pfeifer  <gerald@pfeifer.com>
+
+	* obstacks.texi (Preparing for Obstacks): Remove a (broken)
+	reference to the Glibc manual.
+
+2023-03-03  Costas Argyris  <costas.argyris@gmail.com>
+
+	* pex-win32.c (win32_spawn): Fix memory leak of cmdline
+	buffer and refactor to have cleanup code appear once
+	for all exit cases.
+
+2023-02-11  niXman  <i.nixman@autistici.org>
+
+	* lrealpath.c (lrealpath): try to resolve symlink and
+	use UNC paths where applicable.
+
+2023-01-07  LIU Hao  <lh_mouse@126.com>
+
+	PR middle-end/108300
+	* make-temp-file.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>.
+	* pex-win32.c: Likewise.
+
 2022-11-23  Marek Polacek  <polacek@redhat.com>
 
 	Revert:
diff --git a/libiberty/argv.c b/libiberty/argv.c
index a95a10e14ff..c2823d3e4ba 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -289,8 +289,8 @@ char **buildargv (const char *input)
 @deftypefn Extension int writeargv (char * const *@var{argv}, FILE *@var{file})
 
 Write each member of ARGV, handling all necessary quoting, to the file
-named by FILE, separated by whitespace.  Return 0 on success, non-zero
-if an error occurred while writing to FILE.
+associated with FILE, separated by whitespace.  Return 0 on success,
+non-zero if an error occurred while writing to FILE.
 
 @end deftypefn
 
@@ -299,8 +299,6 @@ if an error occurred while writing to FILE.
 int
 writeargv (char * const *argv, FILE *f)
 {
-  int status = 0;
-
   if (f == NULL)
     return 1;
 
@@ -314,37 +312,26 @@ writeargv (char * const *argv, FILE *f)
 
           if (ISSPACE(c) || c == '\\' || c == '\'' || c == '"')
             if (EOF == fputc ('\\', f))
-              {
-                status = 1;
-                goto done;
-              }
+              return 1;
 
           if (EOF == fputc (c, f))
-            {
-              status = 1;
-              goto done;
-            }
+            return 1;
+	  
           arg++;
         }
 
       /* Write out a pair of quotes for an empty argument.  */
       if (arg == *argv)
-	if (EOF == fputs ("\"\"", f))
-	  {
-	    status = 1;
-	    goto done;
-	  }
+        if (EOF == fputs ("\"\"", f))
+          return 1;
 
       if (EOF == fputc ('\n', f))
-        {
-          status = 1;
-          goto done;
-        }
+        return 1;
+      
       argv++;
     }
 
- done:
-  return status;
+  return 0;
 }
 
 /*
diff --git a/libiberty/configure b/libiberty/configure
index 1ccfac9fb11..dd896270dc6 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -5396,8 +5396,8 @@ case "${enable_shared}" in
   *) shared=yes ;;
 esac
 
-# ...unless --enable-host-shared was passed from top-level config:
-if [ "${enable_host_shared}" = "yes" ]; then
+# ...unless --enable-host-{shared,pie} was passed from top-level config:
+if [ "${enable_host_shared}" = "yes" ] || [ "${enable_host_pie}" = "yes" ]; then
   shared=yes
 fi
 
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 6c1ff9c6093..0748c592704 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -245,8 +245,8 @@ case "${enable_shared}" in
   *) shared=yes ;;
 esac
 
-# ...unless --enable-host-shared was passed from top-level config:
-if [[ "${enable_host_shared}" = "yes" ]]; then
+# ...unless --enable-host-{shared,pie} was passed from top-level config:
+if [[ "${enable_host_shared}" = "yes" ]] || [[ "${enable_host_pie}" = "yes" ]]; then
   shared=yes
 fi
 
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index f2b36bcad68..3bd303a7544 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -1947,6 +1947,7 @@ const struct demangle_operator_info cplus_demangle_operators[] =
   { "ng", NL ("-"),         1 },
   { "nt", NL ("!"),         1 },
   { "nw", NL ("new"),       3 },
+  { "nx", NL ("noexcept"),  1 },
   { "oR", NL ("|="),        2 },
   { "oo", NL ("||"),        2 },
   { "or", NL ("|"),         2 },
@@ -5836,8 +5837,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"))
-	  /* Always print parens for sizeof (type).  */
+	else if (code && (!strcmp (code, "st") || !strcmp (code, "nx")))
+	  /* Always print parens for sizeof (type) and noexcept(expr).  */
 	  {
 	    d_append_char (dpi, '(');
 	    d_print_comp (dpi, options, operand);
@@ -6659,32 +6660,10 @@ d_print_conversion (struct d_print_info *dpi, int options,
       dpt.template_decl = dpi->current_template;
     }
 
-  if (d_left (dc)->type != DEMANGLE_COMPONENT_TEMPLATE)
-    {
-      d_print_comp (dpi, options, d_left (dc));
-      if (dpi->current_template != NULL)
-	dpi->templates = dpt.next;
-    }
-  else
-    {
-      d_print_comp (dpi, options, d_left (d_left (dc)));
-
-      /* For a templated cast operator, we need to remove the template
-	 parameters from scope after printing the operator name,
-	 so we need to handle the template printing here.  */
-      if (dpi->current_template != NULL)
-	dpi->templates = dpt.next;
+  d_print_comp (dpi, options, d_left (dc));
 
-      if (d_last_char (dpi) == '<')
-	d_append_char (dpi, ' ');
-      d_append_char (dpi, '<');
-      d_print_comp (dpi, options, d_right (d_left (dc)));
-      /* Avoid generating two consecutive '>' characters, to avoid
-	 the C++ syntactic ambiguity.  */
-      if (d_last_char (dpi) == '>')
-	d_append_char (dpi, ' ');
-      d_append_char (dpi, '>');
-    }
+  if (dpi->current_template != NULL)
+    dpi->templates = dpt.next;
 }
 
 /* Initialize the information structure we use to pass around
diff --git a/libiberty/lrealpath.c b/libiberty/lrealpath.c
index c662f8fd37e..2578288e8ac 100644
--- a/libiberty/lrealpath.c
+++ b/libiberty/lrealpath.c
@@ -68,8 +68,135 @@ extern char *canonicalize_file_name (const char *);
   /* cygwin has realpath, so it won't get here.  */ 
 # if defined (_WIN32)
 #  define WIN32_LEAN_AND_MEAN
-#  include <windows.h> /* for GetFullPathName */
-# endif
+#  include <windows.h> /* for GetFullPathName/GetFinalPathNameByHandle/
+                          CreateFile/CloseHandle */
+#  define WIN32_REPLACE_SLASHES(_ptr, _len) \
+     for (unsigned i = 0; i != (_len); ++i) \
+       if ((_ptr)[i] == '\\') (_ptr)[i] = '/';
+
+#  define WIN32_UNC_PREFIX "//?/UNC/"
+#  define WIN32_UNC_PREFIX_LEN (sizeof(WIN32_UNC_PREFIX)-1)
+#  define WIN32_IS_UNC_PREFIX(ptr) \
+  (0 == memcmp(ptr, WIN32_UNC_PREFIX, WIN32_UNC_PREFIX_LEN))
+
+#  define WIN32_NON_UNC_PREFIX "//?/"
+#  define WIN32_NON_UNC_PREFIX_LEN (sizeof(WIN32_NON_UNC_PREFIX)-1)
+#  define WIN32_IS_NON_UNC_PREFIX(ptr) \
+  (0 == memcmp(ptr, WIN32_NON_UNC_PREFIX, WIN32_NON_UNC_PREFIX_LEN))
+
+/* Get full path name without symlinks resolution.
+   It also converts all forward slashes to back slashes.
+*/
+char* get_full_path_name(const char *filename) {
+  DWORD len;
+  char *buf, *ptr, *res;
+
+  /* determining the required buffer size.
+     from the man: `If the lpBuffer buffer is too small to contain
+     the path, the return value is the size, in TCHARs, of the buffer
+     that is required to hold the path _and_the_terminating_null_character_`
+  */
+  len = GetFullPathName(filename, 0, NULL, NULL);
+
+  if ( len == 0 )
+    return strdup(filename);
+
+  buf = (char *)malloc(len);
+
+  /* no point to check the result again */
+  len = GetFullPathName(filename, len, buf, NULL);
+  buf[len] = 0;
+
+  /* replace slashes */
+  WIN32_REPLACE_SLASHES(buf, len);
+
+  /* calculate offset based on prefix type */
+  len = WIN32_IS_UNC_PREFIX(buf)
+    ? (WIN32_UNC_PREFIX_LEN - 2)
+    : WIN32_IS_NON_UNC_PREFIX(buf)
+      ? WIN32_NON_UNC_PREFIX_LEN
+      : 0
+  ;
+
+  ptr = buf + len;
+  if ( WIN32_IS_UNC_PREFIX(buf) ) {
+    ptr[0] = '/';
+    ptr[1] = '/';
+  }
+
+  res = strdup(ptr);
+
+  free(buf);
+
+  return res;
+}
+
+# if _WIN32_WINNT >= 0x0600
+
+/* Get full path name WITH symlinks resolution.
+   It also converts all forward slashes to back slashes.
+*/
+char* get_final_path_name(HANDLE fh) {
+  DWORD len;
+  char *buf, *ptr, *res;
+
+  /* determining the required buffer size.
+     from the  man: `If the function fails because lpszFilePath is too
+     small to hold the string plus the terminating null character,
+     the return value is the required buffer size, in TCHARs. This
+     value _includes_the_size_of_the_terminating_null_character_`.
+     but in my testcase I have path with 26 chars, the function
+     returns 26 also, ie without the trailing zero-char...
+  */
+  len = GetFinalPathNameByHandle(
+     fh
+    ,NULL
+    ,0
+    ,FILE_NAME_NORMALIZED | VOLUME_NAME_DOS
+  );
+
+  if ( len == 0 )
+    return NULL;
+
+  len += 1; /* for zero-char */
+  buf = (char *)malloc(len);
+
+  /* no point to check the result again */
+  len = GetFinalPathNameByHandle(
+     fh
+    ,buf
+    ,len
+    ,FILE_NAME_NORMALIZED | VOLUME_NAME_DOS
+  );
+  buf[len] = 0;
+
+  /* replace slashes */
+  WIN32_REPLACE_SLASHES(buf, len);
+
+  /* calculate offset based on prefix type */
+  len = WIN32_IS_UNC_PREFIX(buf)
+    ? (WIN32_UNC_PREFIX_LEN - 2)
+    : WIN32_IS_NON_UNC_PREFIX(buf)
+      ? WIN32_NON_UNC_PREFIX_LEN
+      : 0
+  ;
+
+  ptr = buf + len;
+  if ( WIN32_IS_UNC_PREFIX(buf) ) {
+    ptr[0] = '/';
+    ptr[1] = '/';
+  }
+
+  res = strdup(ptr);
+
+  free(buf);
+
+  return res;
+}
+
+# endif // _WIN32_WINNT >= 0x0600
+
+# endif // _WIN32
 #endif
 
 char *
@@ -128,30 +255,52 @@ lrealpath (const char *filename)
   }
 #endif
 
-  /* The MS Windows method.  If we don't have realpath, we assume we
-     don't have symlinks and just canonicalize to a Windows absolute
-     path.  GetFullPath converts ../ and ./ in relative paths to
-     absolute paths, filling in current drive if one is not given
-     or using the current directory of a specified drive (eg, "E:foo").
-     It also converts all forward slashes to back slashes.  */
+  /* The MS Windows method */
 #if defined (_WIN32)
   {
-    char buf[MAX_PATH];
-    char* basename;
-    DWORD len = GetFullPathName (filename, MAX_PATH, buf, &basename);
-    if (len == 0 || len > MAX_PATH - 1)
-      return strdup (filename);
-    else
-      {
-	/* The file system is case-preserving but case-insensitive,
-	   Canonicalize to lowercase, using the codepage associated
-	   with the process locale.  */
-        CharLowerBuff (buf, len);
-        return strdup (buf);
-      }
-  }
-#endif
+    char *res;
+
+    /* For Windows Vista and greater */
+#if _WIN32_WINNT >= 0x0600
+
+    /* For some reason the function receives just empty `filename`, but not NULL.
+       What should we do in that case?
+       According to `strdup()` implementation
+         (https://elixir.bootlin.com/glibc/latest/source/string/strdup.c)
+       it will alloc 1 byte even for empty but non NULL string.
+       OK, will use `strdup()` for that case.
+    */
+    if ( 0 == strlen(filename) )
+      return strdup(filename);
+
+    HANDLE fh = CreateFile(
+       filename
+      ,FILE_READ_ATTRIBUTES
+      ,FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
+      ,NULL
+      ,OPEN_EXISTING
+      ,FILE_FLAG_BACKUP_SEMANTICS
+      ,NULL
+    );
+
+    if ( fh == INVALID_HANDLE_VALUE ) {
+      res = get_full_path_name(filename);
+    } else {
+      res = get_final_path_name(fh);
+      CloseHandle(fh);
 
-  /* This system is a lost cause, just duplicate the filename.  */
-  return strdup (filename);
+      if ( !res )
+        res = get_full_path_name(filename);
+    }
+
+#else
+
+    /* For Windows XP */
+    res = get_full_path_name(filename);
+
+#endif // _WIN32_WINNT >= 0x0600
+
+    return res;
+  }
+#endif // _WIN32
 }
diff --git a/libiberty/make-temp-file.c b/libiberty/make-temp-file.c
index fae743f3985..1d2f21d6c5c 100644
--- a/libiberty/make-temp-file.c
+++ b/libiberty/make-temp-file.c
@@ -37,6 +37,7 @@ Boston, MA 02110-1301, USA.  */
 #include <sys/file.h>   /* May get R_OK, etc. on some systems.  */
 #endif
 #if defined(_WIN32) && !defined(__CYGWIN__)
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #endif
 #if HAVE_SYS_STAT_H
diff --git a/libiberty/obstacks.texi b/libiberty/obstacks.texi
index b2d2403210b..37d26c90f1b 100644
--- a/libiberty/obstacks.texi
+++ b/libiberty/obstacks.texi
@@ -172,8 +172,8 @@ The value of this variable is a pointer to a function that
 @code{obstack} uses when @code{obstack_chunk_alloc} fails to allocate
 memory.  The default action is to print a message and abort.
 You should supply a function that either calls @code{exit}
-(@pxref{Program Termination, , , libc, The GNU C Library Reference Manual}) or @code{longjmp} (@pxref{Non-Local
-Exits, , , libc, The GNU C Library Reference Manual}) and doesn't return.
+(@pxref{Program Termination, , , libc, The GNU C Library Reference Manual}) 
+or @code{longjmp} and doesn't return.
 
 @smallexample
 void my_obstack_alloc_failed (void)
diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c
index 5f6b420f7b3..f7fe306036b 100644
--- a/libiberty/pex-win32.c
+++ b/libiberty/pex-win32.c
@@ -20,6 +20,7 @@ Boston, MA 02110-1301, USA.  */
 
 #include "pex-common.h"
 
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
 #ifdef HAVE_STDLIB_H
@@ -350,7 +351,7 @@ argv_to_cmdline (char *const *argv)
 	 prevent wasting 2 chars per argument of the CreateProcess 32k char
 	 limit.  We need only escape embedded double-quotes and immediately
 	 preceeding backslash characters.  A sequence of backslach characters
-	 that is not follwed by a double quote character will not be
+	 that is not followed by a double quote character will not be
 	 escaped.  */
       needs_quotes = 0;
       for (j = 0; argv[i][j]; j++)
@@ -365,7 +366,7 @@ argv_to_cmdline (char *const *argv)
 	      /* Escape preceeding backslashes.  */
 	      for (k = j - 1; k >= 0 && argv[i][k] == '\\'; k--)
 		cmdline_len++;
-	      /* Escape the qote character.  */
+	      /* Escape the quote character.  */
 	      cmdline_len++;
 	    }
 	}
@@ -568,7 +569,8 @@ env_compare (const void *a_ptr, const void *b_ptr)
  * target is not actually an executable, such as if it is a shell script. */
 
 static pid_t
-win32_spawn (const char *executable,
+win32_spawn (struct pex_obj *obj,
+         const char *executable,
 	     BOOL search,
 	     char *const *argv,
              char *const *env, /* array of strings of the form: VAR=VALUE */
@@ -576,14 +578,12 @@ win32_spawn (const char *executable,
 	     LPSTARTUPINFO si,
 	     LPPROCESS_INFORMATION pi)
 {
-  char *full_executable;
-  char *cmdline;
+  char *full_executable = NULL;
+  char *cmdline = NULL;
+  pid_t pid = (pid_t) -1;
   char **env_copy;
   char *env_block = NULL;
 
-  full_executable = NULL;
-  cmdline = NULL;
-
   if (env)
     {
       int env_size;
@@ -621,13 +621,42 @@ win32_spawn (const char *executable,
 
   full_executable = find_executable (executable, search);
   if (!full_executable)
-    goto error;
+    goto exit;
   cmdline = argv_to_cmdline (argv);
   if (!cmdline)
-    goto error;
-    
-  /* Create the child process.  */  
-  if (!CreateProcess (full_executable, cmdline, 
+    goto exit;
+  /* If cmdline is too large, CreateProcess will fail with a bad
+     'No such file or directory' error. Try passing it through a
+     temporary response file instead.  */
+  if (strlen (cmdline) > 32767)
+    {
+      char *response_file = make_temp_file ("");
+      /* Register the file for deletion by pex_free.  */
+      ++obj->remove_count;
+      obj->remove = XRESIZEVEC (char *, obj->remove, obj->remove_count);
+      obj->remove[obj->remove_count - 1] = response_file;
+      int fd = pex_win32_open_write (obj, response_file, 0, 0);
+      if (fd == -1)
+        goto exit;
+      FILE *f = pex_win32_fdopenw (obj, fd, 0);
+      /* Don't write argv[0] (program name) to the response file.  */
+      if (writeargv (&argv[1], f))
+        {
+          fclose (f);
+          goto exit;
+        }
+      fclose (f); /* Also closes fd and the underlying OS handle.  */
+      char *response_arg = concat ("@", response_file, NULL);
+      char *response_argv[3] = {argv[0], response_arg, NULL};
+      free (cmdline);
+      cmdline = argv_to_cmdline (response_argv);
+      free (response_arg);
+      if (!cmdline)
+        goto exit;
+    }
+  
+  /* Create the child process.  */
+  if (CreateProcess (full_executable, cmdline,
 		      /*lpProcessAttributes=*/NULL,
 		      /*lpThreadAttributes=*/NULL,
 		      /*bInheritHandles=*/TRUE,
@@ -637,33 +666,25 @@ win32_spawn (const char *executable,
 		      si,
 		      pi))
     {
-      free (env_block);
-
-      free (full_executable);
-
-      return (pid_t) -1;
+      CloseHandle (pi->hThread);
+      pid = (pid_t) pi->hProcess;
     }
 
+ exit:
   /* Clean up.  */
-  CloseHandle (pi->hThread);
-  free (full_executable);
-  free (env_block);
-
-  return (pid_t) pi->hProcess;
-
- error:
   free (env_block);
   free (cmdline);
   free (full_executable);
-
-  return (pid_t) -1;
+  
+  return pid;
 }
 
 /* Spawn a script.  This simulates the Unix script execution mechanism.
    This function is called as a fallback if win32_spawn fails. */
 
 static pid_t
-spawn_script (const char *executable, char *const *argv,
+spawn_script (struct pex_obj *obj,
+              const char *executable, char *const *argv,
               char* const *env,
 	      DWORD dwCreationFlags,
 	      LPSTARTUPINFO si,
@@ -713,20 +734,20 @@ spawn_script (const char *executable, char *const *argv,
 	      executable = strrchr (executable1, '\\') + 1;
 	      if (!executable)
 		executable = executable1;
-	      pid = win32_spawn (executable, TRUE, argv, env,
+	      pid = win32_spawn (obj, executable, TRUE, argv, env,
 				 dwCreationFlags, si, pi);
 #else
 	      if (strchr (executable1, '\\') == NULL)
-		pid = win32_spawn (executable1, TRUE, argv, env,
+		pid = win32_spawn (obj, executable1, TRUE, argv, env,
 				   dwCreationFlags, si, pi);
 	      else if (executable1[0] != '\\')
-		pid = win32_spawn (executable1, FALSE, argv, env,
+		pid = win32_spawn (obj, executable1, FALSE, argv, env,
 				   dwCreationFlags, si, pi);
 	      else
 		{
 		  const char *newex = mingw_rootify (executable1);
 		  *avhere = newex;
-		  pid = win32_spawn (newex, FALSE, argv, env,
+		  pid = win32_spawn (obj, newex, FALSE, argv, env,
 				     dwCreationFlags, si, pi);
 		  if (executable1 != newex)
 		    free ((char *) newex);
@@ -736,7 +757,7 @@ spawn_script (const char *executable, char *const *argv,
 		      if (newex != executable1)
 			{
 			  *avhere = newex;
-			  pid = win32_spawn (newex, FALSE, argv, env,
+			  pid = win32_spawn (obj, newex, FALSE, argv, env,
 					     dwCreationFlags, si, pi);
 			  free ((char *) newex);
 			}
@@ -755,7 +776,7 @@ spawn_script (const char *executable, char *const *argv,
 /* Execute a child.  */
 
 static pid_t
-pex_win32_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED, int flags,
+pex_win32_exec_child (struct pex_obj *obj, int flags,
 		      const char *executable, char * const * argv,
                       char* const* env,
 		      int in, int out, int errdes,
@@ -851,10 +872,10 @@ pex_win32_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED, int flags,
   si.hStdError = stderr_handle;
 
   /* Create the child process.  */  
-  pid = win32_spawn (executable, (flags & PEX_SEARCH) != 0,
+  pid = win32_spawn (obj, executable, (flags & PEX_SEARCH) != 0,
 		     argv, env, dwCreationFlags, &si, &pi);
   if (pid == (pid_t) -1)
-    pid = spawn_script (executable, argv, env, dwCreationFlags,
+    pid = spawn_script (obj, executable, argv, env, dwCreationFlags,
                         &si, &pi);
   if (pid == (pid_t) -1)
     {
diff --git a/libiberty/strstr.c b/libiberty/strstr.c
index c6f68495a33..49209e8229f 100644
--- a/libiberty/strstr.c
+++ b/libiberty/strstr.c
@@ -18,18 +18,23 @@ length, the function returns @var{string}.
 
 #include <stddef.h>
 
-extern int memcmp (const void *, const void *, size_t);
+extern char *strchr (const char *, int);
+extern int strncmp (const void *, const void *, size_t);
 extern size_t strlen (const char *);
 
 char *
 strstr (const char *s1, const char *s2)
 {
+  const char *p = s1;
   const size_t len = strlen (s2);
-  while (*s1)
+
+  if (!len)
+    return s1;
+
+  for (; (p = strchr (p, *s2)) != 0; p++)
     {
-      if (!memcmp (s1, s2, len))
-	return (char *)s1;
-      ++s1;
+      if (strncmp (p, s2, len) == 0)
+	return (char *)p;
     }
   return (0);
 }
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index d9bc7ed4b1f..0acd2d635db 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -1659,3 +1659,33 @@ auto f()::{lambda<typename $T0>(X<$T0>*, X<int>*)#1}::operator()<char>(X<char>*,
 
 _ZZN1XIiE1FEvENKUliE_clEi
 X<int>::F()::{lambda(int)#1}::operator()(int) const
+
+_Z1fIiEv1AIXnxtlT_EEE
+void f<int>(A<noexcept(int{})>)
+
+_ZNO1Ycv1XEv
+Y::operator X() &&
+
+_ZNO1Ycv1XIT_EIvEEv
+Y::operator X<void><void>() &&
+
+_ZNO1Y3bobEv
+Y::bob() &&
+
+_ZNR1Y3bobEv
+Y::bob() &
+
+_ZNKR1YcvRK1XIT_EIvEEv
+Y::operator X<void> const&<void>() const &
+
+_ZZN1XIiEcviEvE1y
+X<int>::operator int()::y
+
+_ZZN1XIiEcv1ZIiEEvE1y
+X<int>::operator Z<int>()::y
+
+_ZZN1Xcv1ZIT_EIiEEvE1y
+X::operator Z<int><int>()::y
+
+_ZZN1XIfEcv1ZIT_EIiEEvE1y
+X<float>::operator Z<int><int>()::y

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit: Update libiberty sources
  2021-07-04 13:54   ` H.J. Lu
@ 2021-07-05 15:25     ` Nick Clifton
  0 siblings, 0 replies; 9+ messages in thread
From: Nick Clifton @ 2021-07-05 15:25 UTC (permalink / raw)
  To: H.J. Lu, Alan Modra, GCC Patches; +Cc: Binutils

Hi H.J.

> My patch is needed to build binutils with LTO.  I submitted a patch for GCC:
> 
> https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574405.html

Very well.  I have reappplied your patch to the mainline and 2.37 branch sources.

Cheers
   Nick



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit: Update libiberty sources
  2021-07-04 12:56 ` Alan Modra
@ 2021-07-04 13:54   ` H.J. Lu
  2021-07-05 15:25     ` Nick Clifton
  0 siblings, 1 reply; 9+ messages in thread
From: H.J. Lu @ 2021-07-04 13:54 UTC (permalink / raw)
  To: Alan Modra, GCC Patches; +Cc: Nick Clifton, Binutils

On Sun, Jul 4, 2021 at 5:56 AM Alan Modra <amodra@gmail.com> wrote:
>
> On Sat, Jul 03, 2021 at 01:56:22PM +0100, Nick Clifton via Binutils wrote:
> > Hi Guys,
> >
> >   I am applying the attached file to synchronize our libiberty sources
> >   with gcc.
>
> This lost commit 50ad1254d503, "GCC: Pass --plugin to AR and RANLIB"
> by the look of it.  HJ, should this have been applied to gcc?
>

My patch is needed to build binutils with LTO.  I submitted a patch for GCC:

https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574405.html

-- 
H.J.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit: Update libiberty sources
  2021-07-03 12:56 Nick Clifton
@ 2021-07-04 12:56 ` Alan Modra
  2021-07-04 13:54   ` H.J. Lu
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Modra @ 2021-07-04 12:56 UTC (permalink / raw)
  To: Nick Clifton, H.J. Lu; +Cc: binutils

On Sat, Jul 03, 2021 at 01:56:22PM +0100, Nick Clifton via Binutils wrote:
> Hi Guys,
> 
>   I am applying the attached file to synchronize our libiberty sources
>   with gcc.

This lost commit 50ad1254d503, "GCC: Pass --plugin to AR and RANLIB"
by the look of it.  HJ, should this have been applied to gcc?

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Commit: Update libiberty sources
@ 2021-07-03 12:56 Nick Clifton
  2021-07-04 12:56 ` Alan Modra
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Clifton @ 2021-07-03 12:56 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit: Update libiberty sources
  2018-01-15 16:03 ` Szabolcs Nagy
@ 2018-01-15 16:08   ` H.J. Lu
  0 siblings, 0 replies; 9+ messages in thread
From: H.J. Lu @ 2018-01-15 16:08 UTC (permalink / raw)
  To: Szabolcs Nagy; +Cc: Nick Clifton, Binutils, nd

On Mon, Jan 15, 2018 at 8:03 AM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> On 10/01/18 13:59, Nick Clifton wrote:
>> Hi Guys,
>>
>>   I have checked in the attached patch to synchronize our copy of the
>>   libiberty sources with those from gcc.
>>
>
> since this commit i see two new symbols in aarch64 libstdc++ that were not
> there before:
>
> $ nm -D libstdc++.so.6.0.25 | grep call_once
> 0000000000095e70 W _ZZSt9call_onceIMSt6threadFvvEJSt17reference_wrapperIS0_EEEvRSt9once_flagOT_DpOT0_ENKUlvE0_clEv
> 0000000000095d10 W
> _ZZSt9call_onceIMSt6threadFvvEJSt17reference_wrapperIS0_EEEvRSt9once_flagOT_DpOT0_ENUlvE0_4_FUNEv
>
> this makes the aarch64 libstdc++ abi tests fail.
>
> curiously only happens when native ld is used, not when cross ld.
> will debug this further, but in case anybody has ideas let me know.
>
>

This is

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83834

-- 
H.J.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit: Update libiberty sources
  2018-01-10 13:59 Nick Clifton
@ 2018-01-15 16:03 ` Szabolcs Nagy
  2018-01-15 16:08   ` H.J. Lu
  0 siblings, 1 reply; 9+ messages in thread
From: Szabolcs Nagy @ 2018-01-15 16:03 UTC (permalink / raw)
  To: Nick Clifton, binutils; +Cc: nd

On 10/01/18 13:59, Nick Clifton wrote:
> Hi Guys,
> 
>   I have checked in the attached patch to synchronize our copy of the
>   libiberty sources with those from gcc.
> 

since this commit i see two new symbols in aarch64 libstdc++ that were not
there before:

$ nm -D libstdc++.so.6.0.25 | grep call_once
0000000000095e70 W _ZZSt9call_onceIMSt6threadFvvEJSt17reference_wrapperIS0_EEEvRSt9once_flagOT_DpOT0_ENKUlvE0_clEv
0000000000095d10 W
_ZZSt9call_onceIMSt6threadFvvEJSt17reference_wrapperIS0_EEEvRSt9once_flagOT_DpOT0_ENUlvE0_4_FUNEv

this makes the aarch64 libstdc++ abi tests fail.

curiously only happens when native ld is used, not when cross ld.
will debug this further, but in case anybody has ideas let me know.


> Cheers
>   Nick
> 
> libiberty/ChangeLog
> 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
> 
> 	Update copyright years.
> 
> 2017-01-02  Richard Biener  <rguenther@suse.de>
> 
> 	PR lto/83452
> 	* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
> 	Do not use UNDEF locals for removed symbols but instead just
> 	define them in the first prevailing section and with no name.
> 	Use the same gnu_lto_v1 name for all removed globals we promote to
> 	WEAK UNDEFs so hpux can use a stub to provide this symbol.  Clear
> 	sh_info and sh_link in removed sections.
> 
> 2017-10-30  Richard Biener  <rguenther@suse.de>
> 
> 	PR lto/82757
> 	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
> 	Strip two leading _s from the __gnu_lto_* symbols.
> 
> 2017-10-24  Alan Modra  <amodra@gmail.com>
> 
> 	PR lto/82687
> 	PR lto/82575
> 	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
> 	Only make __gnu_lto symbols hidden.
> 
> 2017-10-20  Alan Modra  <amodra@gmail.com>
> 
> 	PR lto/82575
> 	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
> 	Make discarded non-local symbols weak and hidden.
> 
> 2017-10-18  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR lto/82598
> 	* simple-object.c (handle_lto_debug_sections): Copy over also
> 	.note.GNU-stack section with unchanged name.
> 	* simple-object-elf.c (SHF_EXECINSTR): Define.
> 	(simple_object_elf_copy_lto_debug_section): Drop SHF_EXECINSTR bit
> 	on .note.GNU-stack section.
> 
> 2017-09-25  Nathan Sidwell  <nathan@acm.org>
> 
> 	PR demangler/82195
> 	* cp-demangle.c (d_encoding): Strip return type when name is a
> 	LOCAL_NAME.
> 	(d_local_name): Strip return type of enclosing TYPED_NAME.
> 	* testsuite/demangle-expected: Add and adjust tests.
> 
> 2017-09-21  Nathan Sidwell  <nathan@acm.org>
> 
> 	PR demangler/82195
> 	* cp-demangle.c (d_name): Revert addition of 'toplevel' parm.
> 	(has_return_type): Recurse for DEMANGLE_COMPONENT_LOCAL_NAME.
> 	(d_encoding): Revert d_name change.  Use is_fnqual_component_type
> 	to strip modifiers that do not belong.
> 	(d_special_name, d_class_enum_type): Revert d_name call change.
> 	(d_expresion_1): Commonize DEMANGLE_COMPONENT_UNARY building.
> 	(d_local_name): Revert parsing of a function type.
> 	(d_print_comp_inner): An inner LOCAL_NAME might contain a
> 	TEMPLATE.
> 	* testsuite/demangle-expected: Add & adjust tests
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Commit: Update libiberty sources
@ 2018-01-10 13:59 Nick Clifton
  2018-01-15 16:03 ` Szabolcs Nagy
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Clifton @ 2018-01-10 13:59 UTC (permalink / raw)
  To: binutils

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

Hi Guys,

  I have checked in the attached patch to synchronize our copy of the
  libiberty sources with those from gcc.

Cheers
  Nick

libiberty/ChangeLog
2018-01-03  Jakub Jelinek  <jakub@redhat.com>

	Update copyright years.

2017-01-02  Richard Biener  <rguenther@suse.de>

	PR lto/83452
	* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
	Do not use UNDEF locals for removed symbols but instead just
	define them in the first prevailing section and with no name.
	Use the same gnu_lto_v1 name for all removed globals we promote to
	WEAK UNDEFs so hpux can use a stub to provide this symbol.  Clear
	sh_info and sh_link in removed sections.

2017-10-30  Richard Biener  <rguenther@suse.de>

	PR lto/82757
	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
	Strip two leading _s from the __gnu_lto_* symbols.

2017-10-24  Alan Modra  <amodra@gmail.com>

	PR lto/82687
	PR lto/82575
	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
	Only make __gnu_lto symbols hidden.

2017-10-20  Alan Modra  <amodra@gmail.com>

	PR lto/82575
	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
	Make discarded non-local symbols weak and hidden.

2017-10-18  Jakub Jelinek  <jakub@redhat.com>

	PR lto/82598
	* simple-object.c (handle_lto_debug_sections): Copy over also
	.note.GNU-stack section with unchanged name.
	* simple-object-elf.c (SHF_EXECINSTR): Define.
	(simple_object_elf_copy_lto_debug_section): Drop SHF_EXECINSTR bit
	on .note.GNU-stack section.

2017-09-25  Nathan Sidwell  <nathan@acm.org>

	PR demangler/82195
	* cp-demangle.c (d_encoding): Strip return type when name is a
	LOCAL_NAME.
	(d_local_name): Strip return type of enclosing TYPED_NAME.
	* testsuite/demangle-expected: Add and adjust tests.

2017-09-21  Nathan Sidwell  <nathan@acm.org>

	PR demangler/82195
	* cp-demangle.c (d_name): Revert addition of 'toplevel' parm.
	(has_return_type): Recurse for DEMANGLE_COMPONENT_LOCAL_NAME.
	(d_encoding): Revert d_name change.  Use is_fnqual_component_type
	to strip modifiers that do not belong.
	(d_special_name, d_class_enum_type): Revert d_name call change.
	(d_expresion_1): Commonize DEMANGLE_COMPONENT_UNARY building.
	(d_local_name): Revert parsing of a function type.
	(d_print_comp_inner): An inner LOCAL_NAME might contain a
	TEMPLATE.
	* testsuite/demangle-expected: Add & adjust tests


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

diff -rup libiberty/argv.c /work/sources/gcc/current/libiberty/argv.c
--- libiberty/argv.c	2017-12-08 10:19:06.929057544 +0000
+++ /work/sources/gcc/current/libiberty/argv.c	2018-01-04 08:06:57.706647863 +0000
@@ -1,5 +1,5 @@
 /* Create and destroy argument vectors (argv's)
-   Copyright (C) 1992-2017 Free Software Foundation, Inc.
+   Copyright (C) 1992-2018 Free Software Foundation, Inc.
    Written by Fred Fish @ Cygnus Support
 
 This file is part of the libiberty library.
diff -rup libiberty/asprintf.c /work/sources/gcc/current/libiberty/asprintf.c
--- libiberty/asprintf.c	2017-12-08 10:19:06.932057507 +0000
+++ /work/sources/gcc/current/libiberty/asprintf.c	2018-01-04 08:06:57.710647821 +0000
@@ -1,6 +1,6 @@
 /* Like sprintf but provides a pointer to malloc'd storage, which must
    be freed by the caller.
-   Copyright (C) 1997-2017 Free Software Foundation, Inc.
+   Copyright (C) 1997-2018 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
 This file is part of the libiberty library.
Only in libiberty: autom4te.cache
diff -rup libiberty/ChangeLog /work/sources/gcc/current/libiberty/ChangeLog
--- libiberty/ChangeLog	2017-12-08 17:04:36.788323879 +0000
+++ /work/sources/gcc/current/libiberty/ChangeLog	2018-01-04 08:06:56.945655887 +0000
@@ -1,3 +1,67 @@
+2018-01-03  Jakub Jelinek  <jakub@redhat.com>
+
+	Update copyright years.
+
+2017-01-02  Richard Biener  <rguenther@suse.de>
+
+	PR lto/83452
+	* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
+	Do not use UNDEF locals for removed symbols but instead just
+	define them in the first prevailing section and with no name.
+	Use the same gnu_lto_v1 name for all removed globals we promote to
+	WEAK UNDEFs so hpux can use a stub to provide this symbol.  Clear
+	sh_info and sh_link in removed sections.
+
+2017-10-30  Richard Biener  <rguenther@suse.de>
+
+	PR lto/82757
+	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
+	Strip two leading _s from the __gnu_lto_* symbols.
+
+2017-10-24  Alan Modra  <amodra@gmail.com>
+
+	PR lto/82687
+	PR lto/82575
+	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
+	Only make __gnu_lto symbols hidden.
+
+2017-10-20  Alan Modra  <amodra@gmail.com>
+
+	PR lto/82575
+	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
+	Make discarded non-local symbols weak and hidden.
+
+2017-10-18  Jakub Jelinek  <jakub@redhat.com>
+
+	PR lto/82598
+	* simple-object.c (handle_lto_debug_sections): Copy over also
+	.note.GNU-stack section with unchanged name.
+	* simple-object-elf.c (SHF_EXECINSTR): Define.
+	(simple_object_elf_copy_lto_debug_section): Drop SHF_EXECINSTR bit
+	on .note.GNU-stack section.
+
+2017-09-25  Nathan Sidwell  <nathan@acm.org>
+
+	PR demangler/82195
+	* cp-demangle.c (d_encoding): Strip return type when name is a
+	LOCAL_NAME.
+	(d_local_name): Strip return type of enclosing TYPED_NAME.
+	* testsuite/demangle-expected: Add and adjust tests.
+
+2017-09-21  Nathan Sidwell  <nathan@acm.org>
+
+	PR demangler/82195
+	* cp-demangle.c (d_name): Revert addition of 'toplevel' parm.
+	(has_return_type): Recurse for DEMANGLE_COMPONENT_LOCAL_NAME.
+	(d_encoding): Revert d_name change.  Use is_fnqual_component_type
+	to strip modifiers that do not belong.
+	(d_special_name, d_class_enum_type): Revert d_name call change.
+	(d_expresion_1): Commonize DEMANGLE_COMPONENT_UNARY building.
+	(d_local_name): Revert parsing of a function type.
+	(d_print_comp_inner): An inner LOCAL_NAME might contain a
+	TEMPLATE.
+	* testsuite/demangle-expected: Add & adjust tests
+
 2017-09-15  Nathan Sidwell  <nathan@acm.org>
 
 	PR demangler/82195
diff -rup libiberty/choose-temp.c /work/sources/gcc/current/libiberty/choose-temp.c
--- libiberty/choose-temp.c	2017-12-08 10:19:06.955057220 +0000
+++ /work/sources/gcc/current/libiberty/choose-temp.c	2018-01-04 08:06:57.707647852 +0000
@@ -1,5 +1,5 @@
 /* Utility to pick a temporary filename prefix.
-   Copyright (C) 1996-2017 Free Software Foundation, Inc.
+   Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/clock.c /work/sources/gcc/current/libiberty/clock.c
--- libiberty/clock.c	2017-12-08 10:19:06.956057207 +0000
+++ /work/sources/gcc/current/libiberty/clock.c	2018-01-04 08:06:57.682648116 +0000
@@ -1,5 +1,5 @@
 /* ANSI-compatible clock function.
-   Copyright (C) 1994-2017 Free Software Foundation, Inc.
+   Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.  This library is free
 software; you can redistribute it and/or modify it under the
diff -rup libiberty/concat.c /work/sources/gcc/current/libiberty/concat.c
--- libiberty/concat.c	2017-12-08 10:19:06.956057207 +0000
+++ /work/sources/gcc/current/libiberty/concat.c	2018-01-04 08:06:57.672648221 +0000
@@ -1,5 +1,5 @@
 /* Concatenate variable number of strings.
-   Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
    Written by Fred Fish @ Cygnus Support
 
 This file is part of the libiberty library.
diff -rup libiberty/copying-lib.texi /work/sources/gcc/current/libiberty/copying-lib.texi
--- libiberty/copying-lib.texi	2017-12-08 10:19:06.972057006 +0000
+++ /work/sources/gcc/current/libiberty/copying-lib.texi	2018-01-04 08:06:57.688648053 +0000
@@ -5,7 +5,7 @@
 @center Version 2.1, February 1999
 
 @display
-Copyright @copyright{} 1991-2017 Free Software Foundation, Inc.
+Copyright @copyright{} 1991-2018 Free Software Foundation, Inc.
 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA
 
 Everyone is permitted to copy and distribute verbatim copies
diff -rup libiberty/cp-demangle.c /work/sources/gcc/current/libiberty/cp-demangle.c
--- libiberty/cp-demangle.c	2017-12-08 17:04:36.794323804 +0000
+++ /work/sources/gcc/current/libiberty/cp-demangle.c	2018-01-04 08:06:57.708647842 +0000
@@ -1,5 +1,5 @@
 /* Demangler for g++ V3 ABI.
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@wasabisystems.com>.
 
    This file is part of the libiberty library, which is part of GCC.
@@ -425,7 +425,7 @@ is_ctor_dtor_or_conversion (struct deman
 
 static struct demangle_component *d_encoding (struct d_info *, int);
 
-static struct demangle_component *d_name (struct d_info *, int);
+static struct demangle_component *d_name (struct d_info *);
 
 static struct demangle_component *d_nested_name (struct d_info *);
 
@@ -484,7 +484,7 @@ static struct demangle_component *d_expr
 
 static struct demangle_component *d_expr_primary (struct d_info *);
 
-static struct demangle_component *d_local_name (struct d_info *, int);
+static struct demangle_component *d_local_name (struct d_info *);
 
 static int d_discriminator (struct d_info *);
 
@@ -1259,6 +1259,8 @@ has_return_type (struct demangle_compone
     {
     default:
       return 0;
+    case DEMANGLE_COMPONENT_LOCAL_NAME:
+      return has_return_type (d_right (dc));
     case DEMANGLE_COMPONENT_TEMPLATE:
       return ! is_ctor_dtor_or_conversion (d_left (dc));
     FNQUAL_COMPONENT_CASE:
@@ -1301,25 +1303,22 @@ static struct demangle_component *
 d_encoding (struct d_info *di, int top_level)
 {
   char peek = d_peek_char (di);
+  struct demangle_component *dc;
 
   if (peek == 'G' || peek == 'T')
-    return d_special_name (di);
+    dc = d_special_name (di);
   else
     {
-      struct demangle_component *dc, *dcr;
-
-      dc = d_name (di, top_level);
+      dc = d_name (di);
 
-      if (dc != NULL && top_level && (di->options & DMGL_PARAMS) == 0)
+      if (!dc)
+	/* Failed already.  */;
+      else if (top_level && (di->options & DMGL_PARAMS) == 0)
 	{
 	  /* Strip off any initial CV-qualifiers, as they really apply
 	     to the `this' parameter, and they were not output by the
 	     v2 demangler without DMGL_PARAMS.  */
-	  while (dc->type == DEMANGLE_COMPONENT_RESTRICT_THIS
-		 || dc->type == DEMANGLE_COMPONENT_VOLATILE_THIS
-		 || dc->type == DEMANGLE_COMPONENT_CONST_THIS
-		 || dc->type == DEMANGLE_COMPONENT_REFERENCE_THIS
-		 || dc->type == DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS)
+	  while (is_fnqual_component_type (dc->type))
 	    dc = d_left (dc);
 
 	  /* If the top level is a DEMANGLE_COMPONENT_LOCAL_NAME, then
@@ -1327,22 +1326,37 @@ d_encoding (struct d_info *di, int top_l
 	     really apply here; this happens when parsing a class
 	     which is local to a function.  */
 	  if (dc->type == DEMANGLE_COMPONENT_LOCAL_NAME)
+	    while (is_fnqual_component_type (d_right (dc)->type))
+	      d_right (dc) = d_left (d_right (dc));
+	}
+      else
+	{
+	  peek = d_peek_char (di);
+	  if (peek != '\0' && peek != 'E')
 	    {
-	      dcr = d_right (dc);
-	      while (is_fnqual_component_type (dcr->type))
-		dcr = d_left (dcr);
-	      dc->u.s_binary.right = dcr;
-	    }
+	      struct demangle_component *ftype;
 
-	  return dc;
-	}
+	      ftype = d_bare_function_type (di, has_return_type (dc));
+	      if (ftype)
+		{
+		  /* If this is a non-top-level local-name, clear the
+		     return type, so it doesn't confuse the user by
+		     being confused with the return type of whaever
+		     this is nested within.  */
+		  if (!top_level && dc->type == DEMANGLE_COMPONENT_LOCAL_NAME
+		      && ftype->type == DEMANGLE_COMPONENT_FUNCTION_TYPE)
+		    d_left (ftype) = NULL;
 
-      peek = d_peek_char (di);
-      if (dc == NULL || peek == '\0' || peek == 'E')
-	return dc;
-      dcr = d_bare_function_type (di, has_return_type (dc));
-      return d_make_comp (di, DEMANGLE_COMPONENT_TYPED_NAME, dc, dcr);
+		  dc = d_make_comp (di, DEMANGLE_COMPONENT_TYPED_NAME,
+				    dc, ftype);
+		}
+	      else
+		dc = NULL;
+	    }
+	}
     }
+
+  return dc;
 }
 
 /* <tagged-name> ::= <name> B <source-name> */
@@ -1383,7 +1397,7 @@ d_abi_tags (struct d_info *di, struct de
 */
 
 static struct demangle_component *
-d_name (struct d_info *di, int top_level)
+d_name (struct d_info *di)
 {
   char peek = d_peek_char (di);
   struct demangle_component *dc;
@@ -1394,7 +1408,7 @@ d_name (struct d_info *di, int top_level
       return d_nested_name (di);
 
     case 'Z':
-      return d_local_name (di, top_level);
+      return d_local_name (di);
 
     case 'U':
       return d_unqualified_name (di);
@@ -2079,11 +2093,11 @@ d_special_name (struct d_info *di)
 
 	case 'H':
 	  return d_make_comp (di, DEMANGLE_COMPONENT_TLS_INIT,
-			      d_name (di, 0), NULL);
+			      d_name (di), NULL);
 
 	case 'W':
 	  return d_make_comp (di, DEMANGLE_COMPONENT_TLS_WRAPPER,
-			      d_name (di, 0), NULL);
+			      d_name (di), NULL);
 
 	default:
 	  return NULL;
@@ -2095,11 +2109,11 @@ d_special_name (struct d_info *di)
 	{
 	case 'V':
 	  return d_make_comp (di, DEMANGLE_COMPONENT_GUARD,
-			      d_name (di, 0), NULL);
+			      d_name (di), NULL);
 
 	case 'R':
 	  {
-	    struct demangle_component *name = d_name (di, 0);
+	    struct demangle_component *name = d_name (di);
 	    return d_make_comp (di, DEMANGLE_COMPONENT_REFTEMP, name,
 				d_number_component (di));
 	  }
@@ -2935,7 +2949,7 @@ d_bare_function_type (struct d_info *di,
 static struct demangle_component *
 d_class_enum_type (struct d_info *di)
 {
-  return d_name (di, 0);
+  return d_name (di);
 }
 
 /* <array-type> ::= A <(positive dimension) number> _ <(element) type>
@@ -3380,13 +3394,10 @@ d_expression_1 (struct d_info *di)
 
 	    if (suffix)
 	      /* Indicate the suffix variant for d_print_comp.  */
-	      return d_make_comp (di, DEMANGLE_COMPONENT_UNARY, op,
-				  d_make_comp (di,
-					       DEMANGLE_COMPONENT_BINARY_ARGS,
-					       operand, operand));
-	    else
-	      return d_make_comp (di, DEMANGLE_COMPONENT_UNARY, op,
-				  operand);
+	      operand = d_make_comp (di, DEMANGLE_COMPONENT_BINARY_ARGS,
+				     operand, operand);
+
+	    return d_make_comp (di, DEMANGLE_COMPONENT_UNARY, op, operand);
 	  }
 	case 2:
 	  {
@@ -3568,7 +3579,7 @@ d_expr_primary (struct d_info *di)
 */
 
 static struct demangle_component *
-d_local_name (struct d_info *di, int top_level)
+d_local_name (struct d_info *di)
 {
   struct demangle_component *function;
   struct demangle_component *name;
@@ -3577,6 +3588,8 @@ d_local_name (struct d_info *di, int top
     return NULL;
 
   function = d_encoding (di, 0);
+  if (!function)
+    return NULL;
 
   if (! d_check_char (di, 'E'))
     return NULL;
@@ -3601,7 +3614,7 @@ d_local_name (struct d_info *di, int top
 	    return NULL;
 	}
 
-      name = d_name (di, 0);
+      name = d_name (di);
 
       if (name
 	  /* Lambdas and unnamed types have internal discriminators
@@ -3609,18 +3622,6 @@ d_local_name (struct d_info *di, int top
 	  && name->type != DEMANGLE_COMPONENT_LAMBDA
 	  && name->type != DEMANGLE_COMPONENT_UNNAMED_TYPE)
 	{
-	  if (!top_level
-	      && d_peek_char (di) != 0 /* Not end of string.  */
-	      && d_peek_char (di) != 'E' /* Not end of nested encoding.  */
-	      && d_peek_char (di) != '_') /* Not discriminator.  */
-	    {
-	      struct demangle_component *args;
-
-	      args = d_bare_function_type (di, has_return_type (name));
-	      name = d_make_comp (di, DEMANGLE_COMPONENT_TYPED_NAME,
-				  name, args);
-	    }
-
 	  /* Read and ignore an optional discriminator.  */
 	  if (! d_discriminator (di))
 	    return NULL;
@@ -3630,6 +3631,13 @@ d_local_name (struct d_info *di, int top
 	name = d_make_default_arg (di, num, name);
     }
 
+  /* Elide the return type of the containing function so as to not
+     confuse the user thinking it is the return type of whatever local
+     function we might be containing.  */
+  if (function->type == DEMANGLE_COMPONENT_TYPED_NAME
+      && d_right (function)->type == DEMANGLE_COMPONENT_FUNCTION_TYPE)
+    d_left (d_right (function)) = NULL;
+
   return d_make_comp (di, DEMANGLE_COMPONENT_LOCAL_NAME, function, name);
 }
 
@@ -4710,32 +4718,21 @@ d_print_comp_inner (struct d_print_info
 	    return;
 	  }
 
-	/* If typed_name is a template, then it applies to the
-	   function type as well.  */
-	if (typed_name->type == DEMANGLE_COMPONENT_TEMPLATE)
-	  {
-	    dpt.next = dpi->templates;
-	    dpi->templates = &dpt;
-	    dpt.template_decl = typed_name;
-	  }
-
 	/* If typed_name is a DEMANGLE_COMPONENT_LOCAL_NAME, then
 	   there may be CV-qualifiers on its right argument which
-	   really apply here; this happens when parsing a class which
+	   really apply here; this happens when parsing a class that
 	   is local to a function.  */
 	if (typed_name->type == DEMANGLE_COMPONENT_LOCAL_NAME)
 	  {
-	    struct demangle_component *local_name;
-
-	    local_name = d_right (typed_name);
-	    if (local_name->type == DEMANGLE_COMPONENT_DEFAULT_ARG)
-	      local_name = local_name->u.s_unary_num.sub;
-	    if (local_name == NULL)
+	    typed_name = d_right (typed_name);
+	    if (typed_name->type == DEMANGLE_COMPONENT_DEFAULT_ARG)
+	      typed_name = typed_name->u.s_unary_num.sub;
+	    if (typed_name == NULL)
 	      {
 		d_print_error (dpi);
 		return;
 	      }
-	    while (is_fnqual_component_type (local_name->type))
+	    while (is_fnqual_component_type (typed_name->type))
 	      {
 		if (i >= sizeof adpm / sizeof adpm[0])
 		  {
@@ -4747,15 +4744,24 @@ d_print_comp_inner (struct d_print_info
 		adpm[i].next = &adpm[i - 1];
 		dpi->modifiers = &adpm[i];
 
-		adpm[i - 1].mod = local_name;
+		adpm[i - 1].mod = typed_name;
 		adpm[i - 1].printed = 0;
 		adpm[i - 1].templates = dpi->templates;
 		++i;
 
-		local_name = d_left (local_name);
+		typed_name = d_left (typed_name);
 	      }
 	  }
 
+	/* If typed_name is a template, then it applies to the
+	   function type as well.  */
+	if (typed_name->type == DEMANGLE_COMPONENT_TEMPLATE)
+	  {
+	    dpt.next = dpi->templates;
+	    dpi->templates = &dpt;
+	    dpt.template_decl = typed_name;
+	  }
+
 	d_print_comp (dpi, options, d_right (dc));
 
 	if (typed_name->type == DEMANGLE_COMPONENT_TEMPLATE)
diff -rup libiberty/cp-demangle.h /work/sources/gcc/current/libiberty/cp-demangle.h
--- libiberty/cp-demangle.h	2017-12-08 10:19:06.992056756 +0000
+++ /work/sources/gcc/current/libiberty/cp-demangle.h	2018-01-04 08:06:57.709647831 +0000
@@ -1,5 +1,5 @@
 /* Internal demangler interface for g++ V3 ABI.
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@wasabisystems.com>.
 
    This file is part of the libiberty library, which is part of GCC.
diff -rup libiberty/cp-demint.c /work/sources/gcc/current/libiberty/cp-demint.c
--- libiberty/cp-demint.c	2017-12-08 10:19:07.002056630 +0000
+++ /work/sources/gcc/current/libiberty/cp-demint.c	2018-01-04 08:06:57.689648042 +0000
@@ -1,5 +1,5 @@
 /* Demangler component interface functions.
-   Copyright (C) 2004-2017 Free Software Foundation, Inc.
+   Copyright (C) 2004-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@wasabisystems.com>.
 
    This file is part of the libiberty library, which is part of GCC.
diff -rup libiberty/cplus-dem.c /work/sources/gcc/current/libiberty/cplus-dem.c
--- libiberty/cplus-dem.c	2017-12-08 10:19:07.013056493 +0000
+++ /work/sources/gcc/current/libiberty/cplus-dem.c	2018-01-04 08:06:57.682648116 +0000
@@ -1,5 +1,5 @@
 /* Demangler for GNU C++
-   Copyright (C) 1989-2017 Free Software Foundation, Inc.
+   Copyright (C) 1989-2018 Free Software Foundation, Inc.
    Written by James Clark (jjc@jclark.uucp)
    Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling
    Modified by Satish Pai (pai@apollo.hp.com) for HP demangling
diff -rup libiberty/crc32.c /work/sources/gcc/current/libiberty/crc32.c
--- libiberty/crc32.c	2017-12-08 10:19:07.014056480 +0000
+++ /work/sources/gcc/current/libiberty/crc32.c	2018-01-04 08:06:57.684648095 +0000
@@ -1,5 +1,5 @@
 /* crc32.c
-   Copyright (C) 2009-2017 Free Software Foundation, Inc.
+   Copyright (C) 2009-2018 Free Software Foundation, Inc.
 
    This file is part of the libiberty library.
 
diff -rup libiberty/d-demangle.c /work/sources/gcc/current/libiberty/d-demangle.c
--- libiberty/d-demangle.c	2017-12-08 10:19:07.035056216 +0000
+++ /work/sources/gcc/current/libiberty/d-demangle.c	2018-01-04 08:06:57.683648105 +0000
@@ -1,5 +1,5 @@
 /* Demangler for the D programming language
-   Copyright (C) 2014-2017 Free Software Foundation, Inc.
+   Copyright (C) 2014-2018 Free Software Foundation, Inc.
    Written by Iain Buclaw (ibuclaw@gdcproject.org)
 
 This file is part of the libiberty library.
diff -rup libiberty/_doprnt.c /work/sources/gcc/current/libiberty/_doprnt.c
--- libiberty/_doprnt.c	2017-12-08 10:19:07.035056216 +0000
+++ /work/sources/gcc/current/libiberty/_doprnt.c	2018-01-04 08:06:57.672648221 +0000
@@ -1,5 +1,5 @@
 /* Provide a version of _doprnt in terms of fprintf.
-   Copyright (C) 1998-2017 Free Software Foundation, Inc.
+   Copyright (C) 1998-2018 Free Software Foundation, Inc.
    Contributed by Kaveh Ghazi  (ghazi@caip.rutgers.edu)  3/29/98
 
 This program is free software; you can redistribute it and/or modify it
diff -rup libiberty/dwarfnames.c /work/sources/gcc/current/libiberty/dwarfnames.c
--- libiberty/dwarfnames.c	2017-12-08 10:19:07.046056079 +0000
+++ /work/sources/gcc/current/libiberty/dwarfnames.c	2018-01-04 08:06:57.675648190 +0000
@@ -1,5 +1,5 @@
 /* Names of various DWARF tags.
-   Copyright (C) 2012-2017 Free Software Foundation, Inc.
+   Copyright (C) 2012-2018 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
    
diff -rup libiberty/dyn-string.c /work/sources/gcc/current/libiberty/dyn-string.c
--- libiberty/dyn-string.c	2017-12-08 10:19:07.047056066 +0000
+++ /work/sources/gcc/current/libiberty/dyn-string.c	2018-01-04 08:06:57.669648253 +0000
@@ -1,5 +1,5 @@
 /* An abstract string datatype.
-   Copyright (C) 1998-2017 Free Software Foundation, Inc.
+   Copyright (C) 1998-2018 Free Software Foundation, Inc.
    Contributed by Mark Mitchell (mark@markmitchell.com).
 
 This file is part of GNU CC.
diff -rup libiberty/fdmatch.c /work/sources/gcc/current/libiberty/fdmatch.c
--- libiberty/fdmatch.c	2017-12-08 10:19:07.048056054 +0000
+++ /work/sources/gcc/current/libiberty/fdmatch.c	2018-01-04 08:06:56.944655897 +0000
@@ -1,5 +1,5 @@
 /* Compare two open file descriptors to see if they refer to the same file.
-   Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/fibheap.c /work/sources/gcc/current/libiberty/fibheap.c
--- libiberty/fibheap.c	2017-12-08 10:19:07.048056054 +0000
+++ /work/sources/gcc/current/libiberty/fibheap.c	2018-01-04 08:06:57.676648179 +0000
@@ -1,5 +1,5 @@
 /* A Fibonacci heap datatype.
-   Copyright (C) 1998-2017 Free Software Foundation, Inc.
+   Copyright (C) 1998-2018 Free Software Foundation, Inc.
    Contributed by Daniel Berlin (dan@cgsoftware.com).
    
 This file is part of GNU CC.
diff -rup libiberty/filename_cmp.c /work/sources/gcc/current/libiberty/filename_cmp.c
--- libiberty/filename_cmp.c	2017-12-08 10:19:07.049056041 +0000
+++ /work/sources/gcc/current/libiberty/filename_cmp.c	2018-01-04 08:06:57.707647852 +0000
@@ -1,6 +1,6 @@
 /* File name comparison routine.
 
-   Copyright (C) 2007-2017 Free Software Foundation, Inc.
+   Copyright (C) 2007-2018 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff -rup libiberty/floatformat.c /work/sources/gcc/current/libiberty/floatformat.c
--- libiberty/floatformat.c	2017-12-08 10:19:07.049056041 +0000
+++ /work/sources/gcc/current/libiberty/floatformat.c	2018-01-04 08:06:57.709647831 +0000
@@ -1,5 +1,5 @@
 /* IEEE floating point support routines, for GDB, the GNU Debugger.
-   Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
diff -rup libiberty/fnmatch.c /work/sources/gcc/current/libiberty/fnmatch.c
--- libiberty/fnmatch.c	2017-12-08 10:19:07.049056041 +0000
+++ /work/sources/gcc/current/libiberty/fnmatch.c	2018-01-04 08:06:57.709647831 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
 NOTE: This source is derived from an old version taken from the GNU C
 Library (glibc).
diff -rup libiberty/fopen_unlocked.c /work/sources/gcc/current/libiberty/fopen_unlocked.c
--- libiberty/fopen_unlocked.c	2017-12-08 10:19:07.050056029 +0000
+++ /work/sources/gcc/current/libiberty/fopen_unlocked.c	2018-01-04 08:06:57.706647863 +0000
@@ -1,5 +1,5 @@
 /* Implement fopen_unlocked and related functions.
-   Copyright (C) 2005-2017 Free Software Foundation, Inc.
+   Copyright (C) 2005-2018 Free Software Foundation, Inc.
    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
 
 This file is part of the libiberty library.
diff -rup libiberty/gather-docs /work/sources/gcc/current/libiberty/gather-docs
--- libiberty/gather-docs	2017-12-08 10:19:07.051056016 +0000
+++ /work/sources/gcc/current/libiberty/gather-docs	2018-01-04 08:06:57.673648211 +0000
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # -*- perl -*-
 
-#   Copyright (C) 2001-2017 Free Software Foundation, Inc.
+#   Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is part of the libiberty library.
 # Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/getopt1.c /work/sources/gcc/current/libiberty/getopt1.c
--- libiberty/getopt1.c	2017-12-08 10:19:07.052056004 +0000
+++ /work/sources/gcc/current/libiberty/getopt1.c	2018-01-04 08:06:57.685648084 +0000
@@ -1,5 +1,5 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987-2017 Free Software Foundation, Inc.
+   Copyright (C) 1987-2018 Free Software Foundation, Inc.
 
    NOTE: This source is derived from an old version taken from the GNU C
    Library (glibc).
diff -rup libiberty/getopt.c /work/sources/gcc/current/libiberty/getopt.c
--- libiberty/getopt.c	2017-12-08 10:19:07.052056004 +0000
+++ /work/sources/gcc/current/libiberty/getopt.c	2018-01-04 08:06:57.707647852 +0000
@@ -3,7 +3,7 @@
    "Keep this file name-space clean" means, talk to drepper@gnu.org
    before changing it!
 
-   Copyright (C) 1987-2017 Free Software Foundation, Inc.
+   Copyright (C) 1987-2018 Free Software Foundation, Inc.
 
    NOTE: This source is derived from an old version taken from the GNU C
    Library (glibc).
diff -rup libiberty/getruntime.c /work/sources/gcc/current/libiberty/getruntime.c
--- libiberty/getruntime.c	2017-12-08 10:19:07.053055991 +0000
+++ /work/sources/gcc/current/libiberty/getruntime.c	2018-01-04 08:06:57.710647821 +0000
@@ -1,5 +1,5 @@
 /* Return time used so far, in microseconds.
-   Copyright (C) 1994-2017 Free Software Foundation, Inc.
+   Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/hashtab.c /work/sources/gcc/current/libiberty/hashtab.c
--- libiberty/hashtab.c	2017-12-08 10:19:07.054055979 +0000
+++ /work/sources/gcc/current/libiberty/hashtab.c	2018-01-04 08:06:57.663648316 +0000
@@ -1,5 +1,5 @@
 /* An expandable hash tables datatype.  
-   Copyright (C) 1999-2017 Free Software Foundation, Inc.
+   Copyright (C) 1999-2018 Free Software Foundation, Inc.
    Contributed by Vladimir Makarov (vmakarov@cygnus.com).
 
 This file is part of the libiberty library.
diff -rup libiberty/hex.c /work/sources/gcc/current/libiberty/hex.c
--- libiberty/hex.c	2017-12-08 10:19:07.054055979 +0000
+++ /work/sources/gcc/current/libiberty/hex.c	2018-01-04 08:06:57.681648126 +0000
@@ -1,5 +1,5 @@
 /* Hex character manipulation support.
-   Copyright (C) 1995-2017 Free Software Foundation, Inc.
+   Copyright (C) 1995-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/lbasename.c /work/sources/gcc/current/libiberty/lbasename.c
--- libiberty/lbasename.c	2017-12-08 10:19:07.055055966 +0000
+++ /work/sources/gcc/current/libiberty/lbasename.c	2018-01-04 08:06:57.710647821 +0000
@@ -1,6 +1,6 @@
 /* Libiberty basename.  Like basename, but is not overridden by the
    system C library.
-   Copyright (C) 2001-2017 Free Software Foundation, Inc.
+   Copyright (C) 2001-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/libiberty.texi /work/sources/gcc/current/libiberty/libiberty.texi
--- libiberty/libiberty.texi	2017-12-08 10:19:07.055055966 +0000
+++ /work/sources/gcc/current/libiberty/libiberty.texi	2018-01-04 08:06:56.943655908 +0000
@@ -24,7 +24,7 @@
 @ifinfo
 This manual describes the GNU @libib library of utility subroutines.
 
-Copyright @copyright{} 2001-2017 Free Software Foundation, Inc.
+Copyright @copyright{} 2001-2018 Free Software Foundation, Inc.
 
       Permission is granted to copy, distribute and/or modify this document
       under the terms of the GNU Free Documentation License, Version 1.3
@@ -50,7 +50,7 @@ notice identical to this one except for
 
 
 @vskip 0pt plus 1filll
-Copyright @copyright{} 2001-2017 Free Software Foundation, Inc.
+Copyright @copyright{} 2001-2018 Free Software Foundation, Inc.
 
       Permission is granted to copy, distribute and/or modify this document
       under the terms of the GNU Free Documentation License, Version 1.3
diff -rup libiberty/lrealpath.c /work/sources/gcc/current/libiberty/lrealpath.c
--- libiberty/lrealpath.c	2017-12-08 10:19:07.056055954 +0000
+++ /work/sources/gcc/current/libiberty/lrealpath.c	2018-01-04 08:06:57.664648306 +0000
@@ -1,7 +1,7 @@
 /* Libiberty realpath.  Like realpath, but more consistent behavior.
    Based on gdb_realpath from GDB.
 
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
 
    This file is part of the libiberty library.
 
diff -rup libiberty/maint-tool /work/sources/gcc/current/libiberty/maint-tool
--- libiberty/maint-tool	2017-12-08 10:19:07.056055954 +0000
+++ /work/sources/gcc/current/libiberty/maint-tool	2018-01-04 08:06:56.944655897 +0000
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # -*- perl -*-
 
-#   Copyright (C) 2001-2017 Free Software Foundation, Inc.
+#   Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is part of the libiberty library.
 # Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/Makefile.in /work/sources/gcc/current/libiberty/Makefile.in
--- libiberty/Makefile.in	2017-12-08 10:19:07.057055941 +0000
+++ /work/sources/gcc/current/libiberty/Makefile.in	2018-01-04 08:06:57.683648105 +0000
@@ -1,7 +1,7 @@
 # Makefile for the libiberty library.
 # Originally written by K. Richard Pixley <rich@cygnus.com>.
 #
-# Copyright (C) 1990-2017 Free Software Foundation, Inc.
+# Copyright (C) 1990-2018 Free Software Foundation, Inc.
 #
 # This file is part of the libiberty library.
 # Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/make-relative-prefix.c /work/sources/gcc/current/libiberty/make-relative-prefix.c
--- libiberty/make-relative-prefix.c	2017-12-08 10:19:07.057055941 +0000
+++ /work/sources/gcc/current/libiberty/make-relative-prefix.c	2018-01-04 08:06:57.673648211 +0000
@@ -1,5 +1,5 @@
 /* Relative (relocatable) prefix support.
-   Copyright (C) 1987-2017 Free Software Foundation, Inc.
+   Copyright (C) 1987-2018 Free Software Foundation, Inc.
 
 This file is part of libiberty.
 
diff -rup libiberty/make-temp-file.c /work/sources/gcc/current/libiberty/make-temp-file.c
--- libiberty/make-temp-file.c	2017-12-08 10:19:07.058055929 +0000
+++ /work/sources/gcc/current/libiberty/make-temp-file.c	2018-01-04 08:06:57.675648190 +0000
@@ -1,5 +1,5 @@
 /* Utility to pick a temporary filename prefix.
-   Copyright (C) 1996-2017 Free Software Foundation, Inc.
+   Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/md5.c /work/sources/gcc/current/libiberty/md5.c
--- libiberty/md5.c	2017-12-08 10:19:07.058055929 +0000
+++ /work/sources/gcc/current/libiberty/md5.c	2018-01-04 08:06:57.686648074 +0000
@@ -1,6 +1,6 @@
 /* md5.c - Functions to compute MD5 message digest of files or memory blocks
    according to the definition of MD5 in RFC 1321 from April 1992.
-   Copyright (C) 1995-2017 Free Software Foundation, Inc.
+   Copyright (C) 1995-2018 Free Software Foundation, Inc.
 
    NOTE: This source is derived from an old version taken from the GNU C
    Library (glibc).
diff -rup libiberty/memmem.c /work/sources/gcc/current/libiberty/memmem.c
--- libiberty/memmem.c	2017-12-08 10:19:07.060055903 +0000
+++ /work/sources/gcc/current/libiberty/memmem.c	2018-01-04 08:06:57.689648042 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
diff -rup libiberty/mempcpy.c /work/sources/gcc/current/libiberty/mempcpy.c
--- libiberty/mempcpy.c	2017-12-08 10:19:07.060055903 +0000
+++ /work/sources/gcc/current/libiberty/mempcpy.c	2018-01-04 08:06:57.663648316 +0000
@@ -1,5 +1,5 @@
 /* Implement the mempcpy function.
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
 
 This file is part of the libiberty library.
diff -rup libiberty/mkstemps.c /work/sources/gcc/current/libiberty/mkstemps.c
--- libiberty/mkstemps.c	2017-12-08 10:19:07.061055891 +0000
+++ /work/sources/gcc/current/libiberty/mkstemps.c	2018-01-04 08:06:57.677648169 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
    This file is derived from mkstemp.c from the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
diff -rup libiberty/objalloc.c /work/sources/gcc/current/libiberty/objalloc.c
--- libiberty/objalloc.c	2017-12-08 10:19:07.061055891 +0000
+++ /work/sources/gcc/current/libiberty/objalloc.c	2018-01-04 08:06:57.708647842 +0000
@@ -1,5 +1,5 @@
 /* objalloc.c -- routines to allocate memory for objects
-   Copyright (C) 1997-2017 Free Software Foundation, Inc.
+   Copyright (C) 1997-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Solutions.
 
 This program is free software; you can redistribute it and/or modify it
diff -rup libiberty/obstack.c /work/sources/gcc/current/libiberty/obstack.c
--- libiberty/obstack.c	2017-12-08 10:19:07.062055879 +0000
+++ /work/sources/gcc/current/libiberty/obstack.c	2018-01-04 08:06:56.943655908 +0000
@@ -1,5 +1,5 @@
 /* obstack.c - subroutines used implicitly by object stack macros
-   Copyright (C) 1988-2017 Free Software Foundation, Inc.
+   Copyright (C) 1988-2018 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
diff -rup libiberty/partition.c /work/sources/gcc/current/libiberty/partition.c
--- libiberty/partition.c	2017-12-08 10:19:07.063055866 +0000
+++ /work/sources/gcc/current/libiberty/partition.c	2018-01-04 08:06:57.688648053 +0000
@@ -1,5 +1,5 @@
 /* List implementation of a partition of consecutive integers.
-   Copyright (C) 2000-2017 Free Software Foundation, Inc.
+   Copyright (C) 2000-2018 Free Software Foundation, Inc.
    Contributed by CodeSourcery, LLC.
 
    This file is part of GNU CC.
diff -rup libiberty/pex-common.c /work/sources/gcc/current/libiberty/pex-common.c
--- libiberty/pex-common.c	2017-12-08 10:19:07.063055866 +0000
+++ /work/sources/gcc/current/libiberty/pex-common.c	2018-01-04 08:06:57.665648295 +0000
@@ -1,5 +1,5 @@
 /* Common code for executing a program in a sub-process.
-   Copyright (C) 2005-2017 Free Software Foundation, Inc.
+   Copyright (C) 2005-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@airs.com>.
 
 This file is part of the libiberty library.
diff -rup libiberty/pex-common.h /work/sources/gcc/current/libiberty/pex-common.h
--- libiberty/pex-common.h	2017-12-08 10:19:07.063055866 +0000
+++ /work/sources/gcc/current/libiberty/pex-common.h	2018-01-04 08:06:57.666648285 +0000
@@ -1,6 +1,6 @@
 /* Utilities to execute a program in a subprocess (possibly linked by pipes
    with other subprocesses), and wait for it.  Shared logic.
-   Copyright (C) 1996-2017 Free Software Foundation, Inc.
+   Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/pex-djgpp.c /work/sources/gcc/current/libiberty/pex-djgpp.c
--- libiberty/pex-djgpp.c	2017-12-08 10:19:07.064055853 +0000
+++ /work/sources/gcc/current/libiberty/pex-djgpp.c	2018-01-04 08:06:57.687648063 +0000
@@ -1,6 +1,6 @@
 /* Utilities to execute a program in a subprocess (possibly linked by pipes
    with other subprocesses), and wait for it.  DJGPP specialization.
-   Copyright (C) 1996-2017 Free Software Foundation, Inc.
+   Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/pexecute.c /work/sources/gcc/current/libiberty/pexecute.c
--- libiberty/pexecute.c	2017-12-08 10:19:07.064055853 +0000
+++ /work/sources/gcc/current/libiberty/pexecute.c	2018-01-04 08:06:57.685648084 +0000
@@ -1,6 +1,6 @@
 /* Utilities to execute a program in a subprocess (possibly linked by pipes
    with other subprocesses), and wait for it.
-   Copyright (C) 2004-2017 Free Software Foundation, Inc.
+   Copyright (C) 2004-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/pex-msdos.c /work/sources/gcc/current/libiberty/pex-msdos.c
--- libiberty/pex-msdos.c	2017-12-08 10:19:07.065055841 +0000
+++ /work/sources/gcc/current/libiberty/pex-msdos.c	2018-01-04 08:06:57.709647831 +0000
@@ -1,6 +1,6 @@
 /* Utilities to execute a program in a subprocess (possibly linked by pipes
    with other subprocesses), and wait for it.  Generic MSDOS specialization.
-   Copyright (C) 1996-2017 Free Software Foundation, Inc.
+   Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/pex-one.c /work/sources/gcc/current/libiberty/pex-one.c
--- libiberty/pex-one.c	2017-12-08 10:19:07.065055841 +0000
+++ /work/sources/gcc/current/libiberty/pex-one.c	2018-01-04 08:06:57.684648095 +0000
@@ -1,5 +1,5 @@
 /* Execute a program and wait for a result.
-   Copyright (C) 2005-2017 Free Software Foundation, Inc.
+   Copyright (C) 2005-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/pex-unix.c /work/sources/gcc/current/libiberty/pex-unix.c
--- libiberty/pex-unix.c	2017-12-08 10:19:07.066055828 +0000
+++ /work/sources/gcc/current/libiberty/pex-unix.c	2018-01-04 08:06:57.707647852 +0000
@@ -1,7 +1,7 @@
 /* Utilities to execute a program in a subprocess (possibly linked by pipes
    with other subprocesses), and wait for it.  Generic Unix version
    (also used for UWIN and VMS).
-   Copyright (C) 1996-2017 Free Software Foundation, Inc.
+   Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/pex-win32.c /work/sources/gcc/current/libiberty/pex-win32.c
--- libiberty/pex-win32.c	2017-12-08 10:19:07.066055828 +0000
+++ /work/sources/gcc/current/libiberty/pex-win32.c	2018-01-04 08:06:57.710647821 +0000
@@ -1,6 +1,6 @@
 /* Utilities to execute a program in a subprocess (possibly linked by pipes
    with other subprocesses), and wait for it.  Generic Win32 specialization.
-   Copyright (C) 1996-2017 Free Software Foundation, Inc.
+   Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/physmem.c /work/sources/gcc/current/libiberty/physmem.c
--- libiberty/physmem.c	2017-12-08 10:19:07.067055816 +0000
+++ /work/sources/gcc/current/libiberty/physmem.c	2018-01-04 08:06:57.685648084 +0000
@@ -1,5 +1,5 @@
 /* Calculate the size of physical memory.
-   Copyright (C) 2000-2017 Free Software Foundation, Inc.
+   Copyright (C) 2000-2018 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff -rup libiberty/putenv.c /work/sources/gcc/current/libiberty/putenv.c
--- libiberty/putenv.c	2017-12-08 10:19:07.067055816 +0000
+++ /work/sources/gcc/current/libiberty/putenv.c	2018-01-04 08:06:57.680648137 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
    This file based on putenv.c in the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
diff -rup libiberty/regex.c /work/sources/gcc/current/libiberty/regex.c
--- libiberty/regex.c	2017-12-08 10:19:07.069055791 +0000
+++ /work/sources/gcc/current/libiberty/regex.c	2018-01-04 08:06:57.679648148 +0000
@@ -3,7 +3,7 @@
    (Implements POSIX draft P1003.2/D11.2, except for some of the
    internationalization features.)
 
-   Copyright (C) 1993-2017 Free Software Foundation, Inc.
+   Copyright (C) 1993-2018 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
diff -rup libiberty/rust-demangle.c /work/sources/gcc/current/libiberty/rust-demangle.c
--- libiberty/rust-demangle.c	2017-12-08 10:19:07.071055766 +0000
+++ /work/sources/gcc/current/libiberty/rust-demangle.c	2018-01-04 08:06:56.942655918 +0000
@@ -1,5 +1,5 @@
 /* Demangler for the Rust programming language
-   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+   Copyright (C) 2016-2018 Free Software Foundation, Inc.
    Written by David Tolnay (dtolnay@gmail.com).
 
 This file is part of the libiberty library.
diff -rup libiberty/safe-ctype.c /work/sources/gcc/current/libiberty/safe-ctype.c
--- libiberty/safe-ctype.c	2017-12-08 10:19:07.071055766 +0000
+++ /work/sources/gcc/current/libiberty/safe-ctype.c	2018-01-04 08:06:57.671648232 +0000
@@ -1,6 +1,6 @@
 /* <ctype.h> replacement macros.
 
-   Copyright (C) 2000-2017 Free Software Foundation, Inc.
+   Copyright (C) 2000-2018 Free Software Foundation, Inc.
    Contributed by Zack Weinberg <zackw@stanford.edu>.
 
 This file is part of the libiberty library.
diff -rup libiberty/setenv.c /work/sources/gcc/current/libiberty/setenv.c
--- libiberty/setenv.c	2017-12-08 10:19:07.072055753 +0000
+++ /work/sources/gcc/current/libiberty/setenv.c	2018-01-04 08:06:56.941655929 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2017 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
    This file based on setenv.c in the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
diff -rup libiberty/setproctitle.c /work/sources/gcc/current/libiberty/setproctitle.c
--- libiberty/setproctitle.c	2017-12-08 10:19:07.073055741 +0000
+++ /work/sources/gcc/current/libiberty/setproctitle.c	2018-01-04 08:06:57.684648095 +0000
@@ -1,5 +1,5 @@
 /* Set the title of a process.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
+   Copyright (C) 2010-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/sha1.c /work/sources/gcc/current/libiberty/sha1.c
--- libiberty/sha1.c	2017-12-08 10:19:07.073055741 +0000
+++ /work/sources/gcc/current/libiberty/sha1.c	2018-01-04 08:06:57.668648264 +0000
@@ -1,7 +1,7 @@
 /* sha1.c - Functions to compute SHA1 message digest of files or
    memory blocks according to the NIST specification FIPS-180-1.
 
-   Copyright (C) 2000-2017 Free Software Foundation, Inc.
+   Copyright (C) 2000-2018 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
diff -rup libiberty/simple-object.c /work/sources/gcc/current/libiberty/simple-object.c
--- libiberty/simple-object.c	2017-12-08 17:04:36.811323590 +0000
+++ /work/sources/gcc/current/libiberty/simple-object.c	2018-01-04 08:06:57.711647810 +0000
@@ -1,5 +1,5 @@
 /* simple-object.c -- simple routines to read and write object files.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
+   Copyright (C) 2010-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Google.
 
 This program is free software; you can redistribute it and/or modify it
@@ -273,6 +273,9 @@ handle_lto_debug_sections (const char **
       *name = *name + sizeof (".gnu.lto_") - 1;
       return 1;
     }
+  /* Copy over .note.GNU-stack section under the same name if present.  */
+  else if (strcmp (*name, ".note.GNU-stack") == 0)
+    return 1;
   return 0;
 }
 
diff -rup libiberty/simple-object-coff.c /work/sources/gcc/current/libiberty/simple-object-coff.c
--- libiberty/simple-object-coff.c	2017-12-08 10:19:07.091055515 +0000
+++ /work/sources/gcc/current/libiberty/simple-object-coff.c	2018-01-04 08:06:57.678648158 +0000
@@ -1,5 +1,5 @@
 /* simple-object-coff.c -- routines to manipulate COFF object files.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
+   Copyright (C) 2010-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Google.
 
 This program is free software; you can redistribute it and/or modify it
diff -rup libiberty/simple-object-common.h /work/sources/gcc/current/libiberty/simple-object-common.h
--- libiberty/simple-object-common.h	2017-12-08 10:19:07.099055415 +0000
+++ /work/sources/gcc/current/libiberty/simple-object-common.h	2018-01-04 08:06:57.686648074 +0000
@@ -1,5 +1,5 @@
 /* simple-object-common.h -- common structs for object file manipulation.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
+   Copyright (C) 2010-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/simple-object-elf.c /work/sources/gcc/current/libiberty/simple-object-elf.c
--- libiberty/simple-object-elf.c	2017-12-08 17:04:36.806323653 +0000
+++ /work/sources/gcc/current/libiberty/simple-object-elf.c	2018-01-04 08:06:56.940655939 +0000
@@ -1,5 +1,5 @@
 /* simple-object-elf.c -- routines to manipulate ELF object files.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
+   Copyright (C) 2010-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Google.
 
 This program is free software; you can redistribute it and/or modify it
@@ -196,6 +196,7 @@ typedef struct {
 
 /* Values for sh_flags field.  */
 
+#define SHF_EXECINSTR	0x00000004	/* Executable section.  */
 #define SHF_EXCLUDE	0x80000000	/* Link editor is to exclude this
 					   section from executable and
 					   shared library that it builds
@@ -235,8 +236,10 @@ typedef struct
 
 #define STB_LOCAL	0	/* Local symbol */
 #define STB_GLOBAL	1	/* Global symbol */
+#define STB_WEAK	2	/* Weak global */
 
 #define STV_DEFAULT	0	/* Visibility is specified by binding type */
+#define STV_HIDDEN	2	/* Can only be seen inside currect component */
 
 /* Functions to fetch and store different ELF types, depending on the
    endianness and size.  */
@@ -1085,8 +1088,10 @@ simple_object_elf_copy_lto_debug_section
   off_t shstroff;
   unsigned char *names;
   unsigned int i;
+  int changed;
   int *pfnret;
   const char **pfnname;
+  unsigned first_shndx = 0;
 
   shdr_size = (ei_class == ELFCLASS32
 	       ? sizeof (Elf32_External_Shdr)
@@ -1154,11 +1159,13 @@ simple_object_elf_copy_lto_debug_section
       ret = (*pfn) (&name);
       pfnret[i - 1] = ret == 1 ? 0 : -1;
       pfnname[i - 1] = name;
+      if (first_shndx == 0
+	  && pfnret[i - 1] == 0)
+	first_shndx = i;
     }
 
   /* Mark sections as preserved that are required by to be preserved
      sections.  */
-  int changed;
   do
     {
       changed = 0;
@@ -1324,6 +1331,15 @@ simple_object_elf_copy_lto_debug_section
 					   sobj->offset + stroff,
 					   (unsigned char *)strings,
 					   strsz, &errmsg, err);
+	      /* Find gnu_lto_ in strings.  */
+	      char *gnu_lto = strings;
+	      while ((gnu_lto = memchr (gnu_lto, 'g',
+					strings + strsz - gnu_lto)))
+		if (strncmp (gnu_lto, "gnu_lto_v1",
+			     strings + strsz - gnu_lto) == 0)
+		  break;
+		else
+		  gnu_lto++;
 	      for (ent = buf; ent < buf + length; ent += entsize)
 		{
 		  unsigned st_shndx = ELF_FETCH_FIELD (type_functions, ei_class,
@@ -1346,9 +1362,6 @@ simple_object_elf_copy_lto_debug_section
 		     and __gnu_lto_slim which otherwise cause endless
 		     LTO plugin invocation.  */
 		  if (st_shndx == SHN_COMMON)
-		    /* Setting st_name to "" seems to work to purge
-		       COMMON symbols (in addition to setting their
-		       size to zero).  */
 		    discard = 1;
 		  /* We also need to remove symbols refering to sections
 		     we'll eventually remove as with fat LTO objects
@@ -1364,18 +1377,36 @@ simple_object_elf_copy_lto_debug_section
 		    {
 		      /* Make discarded symbols undefined and unnamed
 		         in case it is local.  */
-		      if (ELF_ST_BIND (*st_info) == STB_LOCAL)
-			ELF_SET_FIELD (type_functions, ei_class, Sym,
-				       ent, st_name, Elf_Word, 0);
+		      int bind = ELF_ST_BIND (*st_info);
+		      int other = STV_DEFAULT;
+		      if (bind == STB_LOCAL)
+			{
+			  /* Make discarded local symbols unnamed and
+			     defined in the first prevailing section.  */
+			  ELF_SET_FIELD (type_functions, ei_class, Sym,
+					 ent, st_name, Elf_Word, 0);
+			  ELF_SET_FIELD (type_functions, ei_class, Sym,
+					 ent, st_shndx, Elf_Half, first_shndx);
+			}
+		      else
+			{
+			  /* Make discarded global symbols hidden weak
+			     undefined and sharing the gnu_lto_ name.  */
+			  bind = STB_WEAK;
+			  other = STV_HIDDEN;
+			  if (gnu_lto)
+			    ELF_SET_FIELD (type_functions, ei_class, Sym,
+					   ent, st_name, Elf_Word,
+					   gnu_lto - strings);
+			  ELF_SET_FIELD (type_functions, ei_class, Sym,
+					 ent, st_shndx, Elf_Half, SHN_UNDEF);
+			}
+		      *st_other = other;
+		      *st_info = ELF_ST_INFO (bind, STT_NOTYPE);
 		      ELF_SET_FIELD (type_functions, ei_class, Sym,
 				     ent, st_value, Elf_Addr, 0);
 		      ELF_SET_FIELD (type_functions, ei_class, Sym,
 				     ent, st_size, Elf_Word, 0);
-		      ELF_SET_FIELD (type_functions, ei_class, Sym,
-				     ent, st_shndx, Elf_Half, SHN_UNDEF);
-		      *st_info = ELF_ST_INFO (ELF_ST_BIND (*st_info),
-					      STT_NOTYPE);
-		      *st_other = STV_DEFAULT;
 		    }
 		}
 	      XDELETEVEC (strings);
@@ -1398,12 +1429,23 @@ simple_object_elf_copy_lto_debug_section
 	     link.  */
 	  ELF_SET_FIELD (type_functions, ei_class, Shdr,
 			 shdr, sh_type, Elf_Word, SHT_NULL);
+	  ELF_SET_FIELD (type_functions, ei_class, Shdr,
+			 shdr, sh_info, Elf_Word, 0);
+	  ELF_SET_FIELD (type_functions, ei_class, Shdr,
+			 shdr, sh_link, Elf_Word, 0);
 	}
 
       flags = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
 			       shdr, sh_flags, Elf_Addr);
       if (ret == 0)
-	flags &= ~SHF_EXCLUDE;
+	{
+	  /* The debugobj doesn't contain any code, thus no trampolines.
+	     Even when the original object needs trampolines, debugobj
+	     doesn't.  */
+	  if (strcmp (name, ".note.GNU-stack") == 0)
+	    flags &= ~SHF_EXECINSTR;
+	  flags &= ~SHF_EXCLUDE;
+	}
       else if (ret == -1)
 	flags = SHF_EXCLUDE;
       ELF_SET_FIELD (type_functions, ei_class, Shdr,
diff -rup libiberty/simple-object-mach-o.c /work/sources/gcc/current/libiberty/simple-object-mach-o.c
--- libiberty/simple-object-mach-o.c	2017-12-08 10:19:07.110055277 +0000
+++ /work/sources/gcc/current/libiberty/simple-object-mach-o.c	2018-01-04 08:06:57.669648253 +0000
@@ -1,5 +1,5 @@
 /* simple-object-mach-o.c -- routines to manipulate Mach-O object files.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
+   Copyright (C) 2010-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Google.
 
 This program is free software; you can redistribute it and/or modify it
diff -rup libiberty/simple-object-xcoff.c /work/sources/gcc/current/libiberty/simple-object-xcoff.c
--- libiberty/simple-object-xcoff.c	2017-12-08 10:19:07.116055202 +0000
+++ /work/sources/gcc/current/libiberty/simple-object-xcoff.c	2018-01-04 08:06:57.670648242 +0000
@@ -1,5 +1,5 @@
 /* simple-object-coff.c -- routines to manipulate XCOFF object files.
-   Copyright (C) 2013-2017 Free Software Foundation, Inc.
+   Copyright (C) 2013-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Google and David Edelsohn, IBM.
 
 This program is free software; you can redistribute it and/or modify it
diff -rup libiberty/snprintf.c /work/sources/gcc/current/libiberty/snprintf.c
--- libiberty/snprintf.c	2017-12-08 10:19:07.116055202 +0000
+++ /work/sources/gcc/current/libiberty/snprintf.c	2018-01-04 08:06:57.671648232 +0000
@@ -1,5 +1,5 @@
 /* Implement the snprintf function.
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
 
 This file is part of the libiberty library.  This library is free
diff -rup libiberty/sort.c /work/sources/gcc/current/libiberty/sort.c
--- libiberty/sort.c	2017-12-08 10:19:07.116055202 +0000
+++ /work/sources/gcc/current/libiberty/sort.c	2018-01-04 08:06:57.667648274 +0000
@@ -1,5 +1,5 @@
 /* Sorting algorithms.
-   Copyright (C) 2000-2017 Free Software Foundation, Inc.
+   Copyright (C) 2000-2018 Free Software Foundation, Inc.
    Contributed by Mark Mitchell <mark@codesourcery.com>.
 
 This file is part of GNU CC.
diff -rup libiberty/spaces.c /work/sources/gcc/current/libiberty/spaces.c
--- libiberty/spaces.c	2017-12-08 10:19:07.117055189 +0000
+++ /work/sources/gcc/current/libiberty/spaces.c	2018-01-04 08:06:57.664648306 +0000
@@ -1,5 +1,5 @@
 /* Allocate memory region filled with spaces.
-   Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/splay-tree.c /work/sources/gcc/current/libiberty/splay-tree.c
--- libiberty/splay-tree.c	2017-12-08 10:19:07.117055189 +0000
+++ /work/sources/gcc/current/libiberty/splay-tree.c	2018-01-04 08:06:57.666648285 +0000
@@ -1,5 +1,5 @@
 /* A splay-tree datatype.  
-   Copyright (C) 1998-2017 Free Software Foundation, Inc.
+   Copyright (C) 1998-2018 Free Software Foundation, Inc.
    Contributed by Mark Mitchell (mark@markmitchell.com).
 
 This file is part of GNU CC.
diff -rup libiberty/stack-limit.c /work/sources/gcc/current/libiberty/stack-limit.c
--- libiberty/stack-limit.c	2017-12-08 10:19:07.117055189 +0000
+++ /work/sources/gcc/current/libiberty/stack-limit.c	2018-01-04 08:06:57.665648295 +0000
@@ -1,5 +1,5 @@
 /* Increase stack size limit if possible.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
+   Copyright (C) 2011-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.  This library is free
 software; you can redistribute it and/or modify it under the
diff -rup libiberty/stpcpy.c /work/sources/gcc/current/libiberty/stpcpy.c
--- libiberty/stpcpy.c	2017-12-08 10:19:07.118055177 +0000
+++ /work/sources/gcc/current/libiberty/stpcpy.c	2018-01-04 08:06:57.674648200 +0000
@@ -1,5 +1,5 @@
 /* Implement the stpcpy function.
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
 
 This file is part of the libiberty library.
diff -rup libiberty/stpncpy.c /work/sources/gcc/current/libiberty/stpncpy.c
--- libiberty/stpncpy.c	2017-12-08 10:19:07.118055177 +0000
+++ /work/sources/gcc/current/libiberty/stpncpy.c	2018-01-04 08:06:57.676648179 +0000
@@ -1,5 +1,5 @@
 /* Implement the stpncpy function.
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
 
 This file is part of the libiberty library.
diff -rup libiberty/strndup.c /work/sources/gcc/current/libiberty/strndup.c
--- libiberty/strndup.c	2017-12-08 10:19:07.121055139 +0000
+++ /work/sources/gcc/current/libiberty/strndup.c	2018-01-04 08:06:56.939655950 +0000
@@ -1,5 +1,5 @@
 /* Implement the strndup function.
-   Copyright (C) 2005-2017 Free Software Foundation, Inc.
+   Copyright (C) 2005-2018 Free Software Foundation, Inc.
    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
 
 This file is part of the libiberty library.
diff -rup libiberty/strtod.c /work/sources/gcc/current/libiberty/strtod.c
--- libiberty/strtod.c	2017-12-08 10:19:07.123055114 +0000
+++ /work/sources/gcc/current/libiberty/strtod.c	2018-01-04 08:06:57.680648137 +0000
@@ -1,5 +1,5 @@
 /* Implementation of strtod for systems with atof.
-   Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.  This library is free
 software; you can redistribute it and/or modify it under the
diff -rup libiberty/strverscmp.c /work/sources/gcc/current/libiberty/strverscmp.c
--- libiberty/strverscmp.c	2017-12-08 10:19:07.124055102 +0000
+++ /work/sources/gcc/current/libiberty/strverscmp.c	2018-01-04 08:06:57.662648327 +0000
@@ -1,5 +1,5 @@
 /* Compare strings while treating digits characters numerically.
-   Copyright (C) 1997-2017 Free Software Foundation, Inc.
+   Copyright (C) 1997-2018 Free Software Foundation, Inc.
    This file is part of the libiberty library.
    Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
 
diff -rup libiberty/testsuite/demangle-expected /work/sources/gcc/current/libiberty/testsuite/demangle-expected
--- libiberty/testsuite/demangle-expected	2017-12-08 17:04:36.812323578 +0000
+++ /work/sources/gcc/current/libiberty/testsuite/demangle-expected	2017-09-26 08:08:08.487878104 +0100
@@ -3817,14 +3817,14 @@ C::f<int>
 # Another case where we got member function qualifiers wrong.
 --format=gnu-v3 --no-params
 _ZZ3BBdI3FooEvvENK3Fob3FabEv
-void BBd<Foo>()::Fob::Fab() const
-void BBd<Foo>()::Fob::Fab
+BBd<Foo>()::Fob::Fab() const
+BBd<Foo>()::Fob::Fab
 #
 # The same idea one level deeper.
 --format=gnu-v3 --no-params
 _ZZZ3BBdI3FooEvvENK3Fob3FabEvENK3Gob3GabEv
-void BBd<Foo>()::Fob::Fab() const::Gob::Gab() const
-void BBd<Foo>()::Fob::Fab() const::Gob::Gab
+BBd<Foo>()::Fob::Fab() const::Gob::Gab() const
+BBd<Foo>()::Fob::Fab() const::Gob::Gab
 #
 # Yet another member function qualifier problem.
 --format=gnu-v3 --no-params
@@ -4445,7 +4445,7 @@ void f<int>()
 # https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c3
 --format=gnu-v3
 _ZSt7forwardIRN1x14refobjiteratorINS0_3refINS0_4mime30multipart_section_processorObjIZ15get_body_parserIZZN14mime_processor21make_section_iteratorERKNS2_INS3_10sectionObjENS0_10ptrrefBaseEEEbENKUlvE_clEvEUlSB_bE_ZZNS6_21make_section_iteratorESB_bENKSC_clEvEUlSB_E0_ENS1_INS2_INS0_20outputrefiteratorObjIiEES8_EEEERKSsSB_OT_OT0_EUlmE_NS3_32make_multipart_default_discarderISP_EEEES8_EEEEEOT_RNSt16remove_referenceISW_E4typeE
-x::refobjiterator<x::ref<x::mime::multipart_section_processorObj<x::refobjiterator<x::ref<x::outputrefiteratorObj<int>, x::ptrrefBase> > get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> >, x::ptrrefBase> >& std::forward<x::refobjiterator<x::ref<x::mime::multipart_section_processorObj<x::refobjiterator<x::ref<x::outputrefiteratorObj<int>, x::ptrrefBase> > get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> >, x::ptrrefBase> >&>(std::remove_reference<x::mime::multipart_section_processorObj<x::refobjiterator<x::ref<x::outputrefiteratorObj<int>, x::ptrrefBase> > get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> > >::type&)
+x::refobjiterator<x::ref<x::mime::multipart_section_processorObj<get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> >, x::ptrrefBase> >& std::forward<x::refobjiterator<x::ref<x::mime::multipart_section_processorObj<get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> >, x::ptrrefBase> >&>(std::remove_reference<x::mime::multipart_section_processorObj<get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> > >::type&)
 #
 --format=gnu-v3 --no-params
 _ZNK7strings8internal8SplitterINS_9delimiter5AnyOfENS_9SkipEmptyEEcvT_ISt6vectorI12basic_stringIcSt11char_traitsIcESaIcEESaISD_EEvEEv
@@ -4469,28 +4469,28 @@ A::operator C<int><C>
 # https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c16
 --format=gnu-v3
 _ZN3mdr16in_cached_threadIRZNK4cudr6GPUSet17parallel_for_eachIZN5tns3d20shape_representation7compute7GPUImpl7executeERKNS_1AINS_7ptr_refIKjEELl3ELl3ENS_8c_strideILl1ELl0EEEEERKNS8_INS9_IjEELl4ELl1ESD_EEEUliRKNS1_7ContextERNS7_5StateEE_JSt6vectorISO_SaISO_EEEEEvOT_DpRT0_EUlSP_E_JSt17reference_wrapperISO_EEEENS_12ScopedFutureIDTclfp_spcl7forwardISW_Efp0_EEEEESV_DpOSW_
-mdr::ScopedFuture<decltype ({parm#1}(((forward<void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&>)({parm#2}))...))> mdr::in_cached_thread<void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, std::reference_wrapper<tns3d::shape_representation::compute::GPUImpl::State> >(void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, (void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&&&)...)
+mdr::ScopedFuture<decltype ({parm#1}(((forward<cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&>)({parm#2}))...))> mdr::in_cached_thread<cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, std::reference_wrapper<tns3d::shape_representation::compute::GPUImpl::State> >(cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, (cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&&&)...)
 # https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c18
 --format=gnu-v3
 _ZNSt9_Any_data9_M_accessIPZN13ThreadManager10futureTaskISt5_BindIFSt7_Mem_fnIM6RunnerFvvEEPS5_EEEEvOT_EUlvE_EERSC_v
-void ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)>&&)::{lambda()#1}*& std::_Any_data::_M_access<void ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(void ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
+ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)>&&)::{lambda()#1}*& std::_Any_data::_M_access<ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
 # https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c24
 # aka https://sourceware.org/bugzilla/show_bug.cgi?id=16593
 --format=gnu-v3
 _ZNSt9_Any_data9_M_accessIPZN3sel8Selector6SetObjI3FooJPKcMS4_FviEEEEvRT_DpT0_EUlvE_EESA_v
-void sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(Foo&, char const*, void (Foo::*)(int))::{lambda()#1}*& std::_Any_data::_M_access<void sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(void sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(Foo&, char const*, void (Foo::*)(int))::{lambda()#1}*&, char const*, void (Foo::*)(int))::{lambda()#1}*>()
+sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(Foo&, char const*, void (Foo::*)(int))::{lambda()#1}*& std::_Any_data::_M_access<sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(Foo&, char const*, void (Foo::*)(int))::{lambda()#1}*&, char const*, void (Foo::*)(int))::{lambda()#1}*>()
 # https://sourceware.org/bugzilla/show_bug.cgi?id=16752#c1
 --format=gnu-v3
 _ZNSt9_Any_data9_M_accessIPZN13ThreadManager7newTaskIRSt5_BindIFSt7_Mem_fnIM5DiaryFivEEPS5_EEIEEESt6futureINSt9result_ofIFT_DpT0_EE4typeEEOSF_DpOSG_EUlvE_EERSF_v
-std::future<std::result_of<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>& ()>::type> ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&)::{lambda()#1}*& std::_Any_data::_M_access<std::future<std::result_of<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>& ()>::type> ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::future<std::result_of<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>& ()>::type> ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&)::{lambda()#1}*&&)::{lambda()#1}*>()
+ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&)::{lambda()#1}*& std::_Any_data::_M_access<ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&)::{lambda()#1}*&&)::{lambda()#1}*>()
 # https://sourceware.org/bugzilla/show_bug.cgi?id=16752#c6
 --format=gnu-v3
 _ZNSt9_Any_data9_M_accessIPZN6cereal18polymorphic_detail15getInputBindingINS1_16JSONInputArchiveEEENS1_6detail15InputBindingMapIT_E11SerializersERS7_jEUlPvRSt10unique_ptrIvNS5_12EmptyDeleterIvEEEE0_EESA_v
-cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::JSONInputArchive&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*& std::_Any_data::_M_access<cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::JSONInputArchive&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*>()
+cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::JSONInputArchive&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*& std::_Any_data::_M_access<cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::JSONInputArchive&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*>()
 # https://sourceware.org/bugzilla/show_bug.cgi?id=16845#c2
 --format=gnu-v3
 _ZNSt9_Any_data9_M_accessIPZ4postISt8functionIFvvEEEvOT_EUlvE_EERS5_v
-void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std::_Any_data::_M_access<void post<std::function<void ()> >(void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
+post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std::_Any_data::_M_access<post<std::function<void ()> >(post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
 #
 --format=auto --no-params
 _Z3xxxDFyuVb
@@ -4525,7 +4525,7 @@ void function_temp<int>(A<sizeof ((int)(
 #
 --format=gnu-v3
 _Z7ZipWithI7QStringS0_5QListZN4oral6detail16AdaptCreateTableI7AccountEES0_RKNS3_16CachedFieldsDataEEUlRKS0_SA_E_ET1_IDTclfp1_cvT__EcvT0__EEEERKT1_ISC_ERKT1_ISD_ET2_
-QList<decltype ({parm#3}((QString)(), (QString)()))> ZipWith<QString, QString, QList, QString oral::detail::AdaptCreateTable<Account>(oral::detail::CachedFieldsData const&)::{lambda(QString const&, QString const&)#1}>(QList<QString oral::detail::AdaptCreateTable<Account>(oral::detail::CachedFieldsData const&)::{lambda(QString const&, QString const&)#1}> const&, QList<QList> const&, QString oral::detail::AdaptCreateTable<Account>(oral::detail::CachedFieldsData const&)::{lambda(QString const&, QString const&)#1})
+QList<decltype ({parm#3}((QString)(), (QString)()))> ZipWith<QString, QString, QList, oral::detail::AdaptCreateTable<Account>(oral::detail::CachedFieldsData const&)::{lambda(QString const&, QString const&)#1}>(QList<oral::detail::AdaptCreateTable<Account>(oral::detail::CachedFieldsData const&)::{lambda(QString const&, QString const&)#1}> const&, QList<QList> const&, oral::detail::AdaptCreateTable<Account>(oral::detail::CachedFieldsData const&)::{lambda(QString const&, QString const&)#1})
 #
 # These three are symbols generated by g++'s testsuite, which triggered the same bug as above.
 --format=gnu-v3
@@ -4665,7 +4665,7 @@ _Z3eatIPiZ3FoovEUlPT_PT0_E4_EvRS1_RS3_
 void eat<int*, Foo()::{lambda(auto:1*, auto:2*)#6}>(int*&, Foo()::{lambda(auto:1*, auto:2*)#6}&)
 
 _Z3eatIPiZ3BarIsEvvEUlPsPT_PT0_E0_EvRS3_RS5_
-void eat<int*, void Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}>(int*&, void Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}&)
+void eat<int*, Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}>(int*&, Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}&)
 
 # PR 77489
 _ZZ3foovE8localVar_9
@@ -4739,14 +4739,28 @@ __thunk_4294967297__$_1x
 # demangler/82195 members of lambdas
 --no-params
 _ZZZ3FoovENKUlT_E_clIiEEfS_EN5Local2fnEv
-Foo()::float {lambda(auto:1)#1}::operator()<int>(int) const::Local::fn()
-Foo()::float {lambda(auto:1)#1}::operator()<int>(int) const::Local::fn
+Foo()::{lambda(auto:1)#1}::operator()<int>(int) const::Local::fn()
+Foo()::{lambda(auto:1)#1}::operator()<int>(int) const::Local::fn
 --no-params
 _Z7CaptureIZZ3FoovENKUlT_E_clIiEEvS0_EUlvE_EvOS0_
-void Capture<Foo()::void {lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>(Foo()::void {lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}&&)
-Capture<Foo()::void {lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>
+void Capture<Foo()::{lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>(Foo()::{lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}&&)
+Capture<Foo()::{lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>
 --no-params
 _Z4FrobIZZ3FoovENKUlT_E_clIiEEvS0_EUlvE_Evv
-void Frob<Foo()::void {lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>()
-Frob<Foo()::void {lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>
-#
+void Frob<Foo()::{lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>()
+Frob<Foo()::{lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>
+# A lambda {local-class::member-fn}
+--no-params
+_ZZ3FoovENKUlT_E_clIiEEfS_
+float Foo()::{lambda(auto:1)#1}::operator()<int>(int) const
+Foo()::{lambda(auto:1)#1}::operator()<int>
+# template-fn {local-class::member-fn}
+--no-params
+_ZZ3FooIiEfvEN1X2fnEv
+Foo<int>()::X::fn()
+Foo<int>()::X::fn
+# template-fn generic-lambda local-class::member-fn
+--no-params
+_ZZZ3FooIiEfvENKUlT_E_clIcEEDaS0_EN1X2fnEv
+Foo<int>()::{lambda(auto:1)#1}::operator()<char>(char) const::X::fn()
+Foo<int>()::{lambda(auto:1)#1}::operator()<char>(char) const::X::fn
diff -rup libiberty/testsuite/demangler-fuzzer.c /work/sources/gcc/current/libiberty/testsuite/demangler-fuzzer.c
--- libiberty/testsuite/demangler-fuzzer.c	2017-12-08 10:19:14.093967601 +0000
+++ /work/sources/gcc/current/libiberty/testsuite/demangler-fuzzer.c	2018-01-04 08:06:56.946655876 +0000
@@ -1,6 +1,6 @@
 /* Demangler fuzzer.
 
-   Copyright (C) 2014-2017 Free Software Foundation, Inc.
+   Copyright (C) 2014-2018 Free Software Foundation, Inc.
 
    This file is part of GNU libiberty.
 
diff -rup libiberty/testsuite/Makefile.in /work/sources/gcc/current/libiberty/testsuite/Makefile.in
--- libiberty/testsuite/Makefile.in	2017-12-08 10:19:14.102967488 +0000
+++ /work/sources/gcc/current/libiberty/testsuite/Makefile.in	2018-01-04 08:06:56.945655887 +0000
@@ -1,6 +1,6 @@
 #
 # Makefile
-#   Copyright (C) 1999-2017 Free Software Foundation, Inc.
+#   Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is part of the libiberty library.
 # Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/testsuite/test-demangle.c /work/sources/gcc/current/libiberty/testsuite/test-demangle.c
--- libiberty/testsuite/test-demangle.c	2017-12-08 10:19:14.103967476 +0000
+++ /work/sources/gcc/current/libiberty/testsuite/test-demangle.c	2018-01-04 08:06:56.947655866 +0000
@@ -1,5 +1,5 @@
 /* Demangler test program,
-   Copyright (C) 2002-2017 Free Software Foundation, Inc.
+   Copyright (C) 2002-2018 Free Software Foundation, Inc.
    Written by Zack Weinberg <zack@codesourcery.com
 
    This file is part of GNU libiberty.
diff -rup libiberty/testsuite/test-expandargv.c /work/sources/gcc/current/libiberty/testsuite/test-expandargv.c
--- libiberty/testsuite/test-expandargv.c	2017-12-08 10:19:14.103967476 +0000
+++ /work/sources/gcc/current/libiberty/testsuite/test-expandargv.c	2018-01-04 08:06:56.947655866 +0000
@@ -1,5 +1,5 @@
 /* expandargv test program,
-   Copyright (C) 2006-2017 Free Software Foundation, Inc.
+   Copyright (C) 2006-2018 Free Software Foundation, Inc.
    Written by Carlos O'Donell <carlos@codesourcery.com>
 
    This file is part of the libiberty library, which is part of GCC.
diff -rup libiberty/testsuite/test-pexecute.c /work/sources/gcc/current/libiberty/testsuite/test-pexecute.c
--- libiberty/testsuite/test-pexecute.c	2017-12-08 10:19:14.103967476 +0000
+++ /work/sources/gcc/current/libiberty/testsuite/test-pexecute.c	2018-01-04 08:06:56.945655887 +0000
@@ -1,5 +1,5 @@
 /* Pexecute test program,
-   Copyright (C) 2005-2017 Free Software Foundation, Inc.
+   Copyright (C) 2005-2018 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@airs.com>.
 
    This file is part of GNU libiberty.
diff -rup libiberty/testsuite/test-strtol.c /work/sources/gcc/current/libiberty/testsuite/test-strtol.c
--- libiberty/testsuite/test-strtol.c	2017-12-08 10:19:14.103967476 +0000
+++ /work/sources/gcc/current/libiberty/testsuite/test-strtol.c	2018-01-04 08:06:56.946655876 +0000
@@ -1,5 +1,5 @@
 /* Test program for strtol family of funtions,
-   Copyright (C) 2014-2017 Free Software Foundation, Inc.
+   Copyright (C) 2014-2018 Free Software Foundation, Inc.
    Written by Yury Gribov <y.gribov@samsung.com>
 
    This file is part of the libiberty library, which is part of GCC.
diff -rup libiberty/timeval-utils.c /work/sources/gcc/current/libiberty/timeval-utils.c
--- libiberty/timeval-utils.c	2017-12-08 10:19:07.125055089 +0000
+++ /work/sources/gcc/current/libiberty/timeval-utils.c	2018-01-04 08:06:57.687648063 +0000
@@ -1,5 +1,5 @@
 /* Basic struct timeval utilities.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
+   Copyright (C) 2011-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/unlink-if-ordinary.c /work/sources/gcc/current/libiberty/unlink-if-ordinary.c
--- libiberty/unlink-if-ordinary.c	2017-12-08 10:19:07.125055089 +0000
+++ /work/sources/gcc/current/libiberty/unlink-if-ordinary.c	2018-01-04 08:06:57.674648200 +0000
@@ -1,5 +1,5 @@
 /* unlink-if-ordinary.c - remove link to a file unless it is special
-   Copyright (C) 2004-2017 Free Software Foundation, Inc.
+   Copyright (C) 2004-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.  This library is free
 software; you can redistribute it and/or modify it under the
diff -rup libiberty/vasprintf.c /work/sources/gcc/current/libiberty/vasprintf.c
--- libiberty/vasprintf.c	2017-12-08 10:19:07.126055076 +0000
+++ /work/sources/gcc/current/libiberty/vasprintf.c	2018-01-04 08:06:57.708647842 +0000
@@ -1,6 +1,6 @@
 /* Like vsprintf but provides a pointer to malloc'd storage, which must
    be freed by the caller.
-   Copyright (C) 1994-2017 Free Software Foundation, Inc.
+   Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/vfprintf.c /work/sources/gcc/current/libiberty/vfprintf.c
--- libiberty/vfprintf.c	2017-12-08 10:19:07.127055064 +0000
+++ /work/sources/gcc/current/libiberty/vfprintf.c	2018-01-04 08:06:57.686648074 +0000
@@ -1,6 +1,6 @@
 /* Provide a version vfprintf in terms of _doprnt.
    By Kaveh Ghazi  (ghazi@caip.rutgers.edu)  3/29/98
-   Copyright (C) 1998-2017 Free Software Foundation, Inc.
+   Copyright (C) 1998-2018 Free Software Foundation, Inc.
  */
 
 #include "ansidecl.h"
diff -rup libiberty/vprintf-support.c /work/sources/gcc/current/libiberty/vprintf-support.c
--- libiberty/vprintf-support.c	2017-12-08 10:19:07.127055064 +0000
+++ /work/sources/gcc/current/libiberty/vprintf-support.c	2018-01-04 08:06:56.941655929 +0000
@@ -1,6 +1,6 @@
 /* Estimate the length of the string generated by a vprintf-like
    function.  Used by vasprintf and xvasprintf.
-   Copyright (C) 1994-2017 Free Software Foundation, Inc.
+   Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/vprintf-support.h /work/sources/gcc/current/libiberty/vprintf-support.h
--- libiberty/vprintf-support.h	2017-12-08 10:19:07.127055064 +0000
+++ /work/sources/gcc/current/libiberty/vprintf-support.h	2018-01-04 08:06:56.942655918 +0000
@@ -1,6 +1,6 @@
 /* Estimate the length of the string generated by a vprintf-like
    function.  Use by vasprintf and xvasprintf.
-   Copyright (C) 1994-2017 Free Software Foundation, Inc.
+   Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/vsnprintf.c /work/sources/gcc/current/libiberty/vsnprintf.c
--- libiberty/vsnprintf.c	2017-12-08 10:19:07.128055052 +0000
+++ /work/sources/gcc/current/libiberty/vsnprintf.c	2018-01-04 08:06:57.667648274 +0000
@@ -1,5 +1,5 @@
 /* Implement the vsnprintf function.
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
 
 This file is part of the libiberty library.  This library is free
diff -rup libiberty/vsprintf.c /work/sources/gcc/current/libiberty/vsprintf.c
--- libiberty/vsprintf.c	2017-12-08 10:19:07.129055039 +0000
+++ /work/sources/gcc/current/libiberty/vsprintf.c	2018-01-04 08:06:57.688648053 +0000
@@ -3,7 +3,7 @@
    implementations of stdio; newer ones should already have vsprintf.
    Written by Per Bothner of Cygnus Support.
    Based on libg++'s "form" (written by Doug Lea; dl@rocky.oswego.edu).
-   Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.  This library is free
 software; you can redistribute it and/or modify it under the
diff -rup libiberty/xasprintf.c /work/sources/gcc/current/libiberty/xasprintf.c
--- libiberty/xasprintf.c	2017-12-08 10:19:07.139054913 +0000
+++ /work/sources/gcc/current/libiberty/xasprintf.c	2018-01-04 08:06:57.679648148 +0000
@@ -1,5 +1,5 @@
 /* Implement the xasprintf function.
-   Copyright (C) 2014-2017 Free Software Foundation, Inc.
+   Copyright (C) 2014-2018 Free Software Foundation, Inc.
    Contributed by Manuel Lopez-Ibanez.
 
 This file is part of the libiberty library.
diff -rup libiberty/xexit.c /work/sources/gcc/current/libiberty/xexit.c
--- libiberty/xexit.c	2017-12-08 10:19:07.140054901 +0000
+++ /work/sources/gcc/current/libiberty/xexit.c	2018-01-04 08:06:56.940655939 +0000
@@ -1,5 +1,5 @@
 /* xexit.c -- Run any exit handlers, then exit.
-   Copyright (C) 1994-2017 Free Software Foundation, Inc.
+   Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/xmalloc.c /work/sources/gcc/current/libiberty/xmalloc.c
--- libiberty/xmalloc.c	2017-12-08 10:19:07.141054889 +0000
+++ /work/sources/gcc/current/libiberty/xmalloc.c	2018-01-04 08:06:57.670648242 +0000
@@ -1,5 +1,5 @@
 /* memory allocation routines with error checking.
-   Copyright (C) 1989-2017 Free Software Foundation, Inc.
+   Copyright (C) 1989-2018 Free Software Foundation, Inc.
    
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff -rup libiberty/xstrndup.c /work/sources/gcc/current/libiberty/xstrndup.c
--- libiberty/xstrndup.c	2017-12-08 10:19:07.142054876 +0000
+++ /work/sources/gcc/current/libiberty/xstrndup.c	2018-01-04 08:06:57.681648126 +0000
@@ -1,5 +1,5 @@
 /* Implement the xstrndup function.
-   Copyright (C) 2005-2017 Free Software Foundation, Inc.
+   Copyright (C) 2005-2018 Free Software Foundation, Inc.
    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
 
 This file is part of the libiberty library.
diff -rup libiberty/xvasprintf.c /work/sources/gcc/current/libiberty/xvasprintf.c
--- libiberty/xvasprintf.c	2017-12-08 10:19:07.142054876 +0000
+++ /work/sources/gcc/current/libiberty/xvasprintf.c	2018-01-04 08:06:57.677648169 +0000
@@ -1,5 +1,5 @@
 /* Implement the xvasprintf function.
-   Copyright (C) 2014-2017 Free Software Foundation, Inc.
+   Copyright (C) 2014-2018 Free Software Foundation, Inc.
    Contributed by Manuel Lopez-Ibanez.
 
 This file is part of the libiberty library.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Commit: Update libiberty sources
@ 2017-09-01  9:59 Nick Clifton
  0 siblings, 0 replies; 9+ messages in thread
From: Nick Clifton @ 2017-09-01  9:59 UTC (permalink / raw)
  To: binutils

Hi Guys,

  I have taken the liberty of updating the libiberty sources on the
  mainline and 2.29 branch with the latest bugfixes from the GCC
  sources.

Cheers
  Nick

diff -rupN /work/sources/binutils/current/libiberty/ChangeLog libiberty/ChangeLog
--- /work/sources/binutils/current/libiberty/ChangeLog	2017-07-10 08:07:36.116184176 +0100
+++ libiberty/ChangeLog	2017-09-01 08:09:43.141775002 +0100
@@ -1,18 +1,80 @@
+2017-08-31  Richard Biener  <rguenther@suse.de>
+
+	PR lto/81968
+	* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
+	Keep names of removed global symbols.
+
+2017-08-29  Tony Reix  <tony.reix@atos.net>
+
+	* simple-object-xcoff.c (simple_object_xcoff_find_sections):
+	Improve .go_export csect handling.  Don't make assumptions
+	on containing section or number of auxiliary entries.
+
+2017-08-28  Richard Biener  <rguenther@suse.de>
+
+	PR lto/81968
+	* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
+	Adjust field with for sh_type write, set SHF_EXCLUDE only for
+	removed sections.
+
+2017-08-22  Richard Biener  <rguenther@suse.de>
+
+	PR lto/81925
+	* simple-object-elf.c (simple_object_elf_write_shdr): Adjust
+	type of sh_addralign and sh_entsize and properly write
+	sh_entsize as Elf_Addr.
+	(simple_object_elf_write_to_file): Read sh_entsize as Elf_Addr.
+
+2017-08-21  Richard Biener  <rguenther@suse.de>
+
+	* simple-object-common.h (struct simple_object_functions): Add
+	copy_lto_debug_sections hook.
+	* simple-object.c: Include fcntl.h.
+	(handle_lto_debug_sections): New helper function.
+	(simple_object_copy_lto_debug_sections): New function copying
+	early LTO debug sections to regular debug sections in a new file.
+	(simple_object_start_write): Handle NULL segment_name.
+	* simple-object-coff.c (simple_object_coff_functions): Adjust
+	for not implemented copy_lto_debug_sections hook.
+	* simple-object-mach-o.c (simple_object_mach_o_functions): Likewise.
+	* simple-object-xcoff.c (simple_object_xcoff_functions): Likewise.
+	* simple-object-elf.c (SHT_NULL, SHT_SYMTAB, SHT_RELA, SHT_REL,
+	SHT_GROUP): Add various sectopn header types.
+	(SHF_EXCLUDE): Add flag.
+	(Elf32_External_Sym, Elf64_External_Sym): Add symbol struct.
+	(ELF_ST_BIND, ELF_ST_TYPE, ELF_ST_INFO): Add accessors.
+	(STT_OBJECT, STT_FUNC, STT_TLS, STT_GNU_IFUNC): Add Symbol types.
+	(STV_DEFAULT): Add symbol visibility.
+	(SHN_COMMON): Add special section index name.
+	(struct simple_object_elf_write): New.
+	(simple_object_elf_start_write): Adjust for new private data.
+	(simple_object_elf_write_shdr): Pass in values for all fields
+	we write.
+	(simple_object_elf_write_to_file): Adjust.  Copy from recorded
+	section headers if requested.
+	(simple_object_elf_release_write): Release private data.
+	(simple_object_elf_copy_lto_debug_sections): Copy and rename sections
+	as denoted by PFN and all their dependences, symbols and relocations
+	to the empty destination file.
+	(simple_object_elf_functions): Adjust for copy_lto_debug_sections hook.
+
 2017-07-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* dwarfnames.c (DW_FIRST_IDX, DW_END_IDX, DW_IDX, DW_IDX_DUP): New.
 
+2017-06-07  Tony Reix  <tony.reix@atos.net>
+	    Matthieu Sarter  <matthieu.sarter.external@atos.net>
+	    David Edelsohn  <dje.gcc@gmail.com>
+
+	* simple-object-xcoff.c (simple_object_xcoff_find_sections):
+	Search symbol table for .go_export symbol and apply pfn if found.
+

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-26 14:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-26 14:46 Commit: Update libiberty sources Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
2021-07-03 12:56 Nick Clifton
2021-07-04 12:56 ` Alan Modra
2021-07-04 13:54   ` H.J. Lu
2021-07-05 15:25     ` 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

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