Synchronize libbierty sources with gcc.
authorNick Clifton <nickc@redhat.com>
Mon, 4 Jul 2022 12:57:12 +0000 (13:57 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 4 Jul 2022 12:57:12 +0000 (13:57 +0100)
ChangeLog
libiberty/ChangeLog
libiberty/configure
libiberty/configure.ac
libiberty/rust-demangle.c

index e6b3e58b8f0b64c3619f062f4be2298cd5dfcb9e..59f708179247cdd15c5443d0c3b0d7c5b4d5dc94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2022-07-04  Nick Clifton  <nickc@redhat.com>
+
+       * libiberty: Synchronize with GCC.  Bring in:
+       2022-07-01  Nick Clifton  <nickc@redhat.com>
+
+       PR demangler/105039
+       * rust-demangle.c (demangle_const): Add recursion limit.
+
+       2022-06-26  Simon Marchi  <simon.marchi@efficios.com>
+
+       * configure.ac: Add AC_CONFIG_MACRO_DIRS call.
+       * configure: Re-generate.
+
 2022-04-12  Nick Clifton  <nickc@redhat.com>
 
        * zlib: Rebase to the 1.2.12 release.
index de3a6eeef527eadd2ef3430b63d5bd706f989d90..f84e4076ee5c3a50b0a61dd696a7a197e8de8025 100644 (file)
@@ -1,7 +1,145 @@
+2022-07-01  Nick Clifton  <nickc@redhat.com>
+
+       PR demangler/105039
+       * rust-demangle.c (demangle_const): Add recursion limit.
+
+2022-06-26  Simon Marchi  <simon.marchi@efficios.com>
+
+       * configure.ac: Add AC_CONFIG_MACRO_DIRS call.
+       * configure: Re-generate.
+
+2022-05-23  Nathan Sidwell  <nathan@acm.org>
+
+       * cp-demangle.c (d_make_comp): Adjust.
+       (d_name, d_prefix): Adjust subst handling. Add module handling.
+       (d_maybe_module_name): New.
+       (d_unqualified_name): Add incoming module parm. Handle it.  Adjust all callers.
+       (d_special_name): Add 'GI' support.
+       (d_count_template_scopes): Adjust.
+       (d_print_comp_inner): Print module.
+       * testsuite/demangle-expected: New test cases
+
+2022-05-18  Nathan Sidwell  <nathan@acm.org>
+
+       * cp-demangle.c (d_name): Add SUBSTABLE parameter,
+       push substitution if requested. Adjust unscoped name handling.
+       (d_prefix): Reorder main loop. Adjust all calls.
+       (d_unqualified_name): Add SCOPE parameter, create qualified
+       name here. Adjust all calls.
+       (cplus_demangle_type): Do not handle 'S' here, leave all
+       to d_class_enum_type.
+       (d_class_enum_type): Add SUBSTABLE parameter.
+
+2022-05-17  Nathan Sidwell  <nathan@acm.org>
+
+       * cp-demangle.c (d_make_comp): Adjust.
+       (d_unqualified_name): Add 'DC' support.
+       (d_count_template_scopes): Adjust.
+       (d_print_comp_inner): Add structured binding.
+       * testsuite/demangle-expected: Add testcases.
+
+2022-05-10  Martin Liska  <mliska@suse.cz>
+
+       * regex.c: Restore comments.
+
+2022-05-10  Martin Liska  <mliska@suse.cz>
+           Alan Modra  <amodra@gmail.com>
+
+       * hashtab.c (htab_empty): Use void * type instead of void **.
+       (htab_expand): Likewise.
+
+2022-05-10  Martin Liska  <mliska@suse.cz>
+
+       * random.c: Remove 'define PTR'.
+
+2022-05-10  Martin Liska  <mliska@suse.cz>
+
+       * alloca.c (C_alloca): Use void * instead PTR.
+       * calloc.c (malloc): Likewise.
+       (bzero): Likewise.
+       (calloc): Likewise.
+       * hashtab.c (find_empty_slot_for_expand): Likewise.
+       (eq_pointer): Likewise.
+       (htab_create_alloc_ex): Likewise.
+       (htab_create_typed_alloc): Likewise.
+       (htab_set_functions_ex): Likewise.
+       (htab_delete): Likewise.
+       (htab_empty): Likewise.
+       (htab_expand): Likewise.
+       (htab_find_with_hash): Likewise.
+       (htab_find): Likewise.
+       (htab_find_slot_with_hash): Likewise.
+       (htab_find_slot): Likewise.
+       (htab_remove_elt): Likewise.
+       (htab_remove_elt_with_hash): Likewise.
+       (htab_clear_slot): Likewise.
+       (htab_traverse_noresize): Likewise.
+       (htab_traverse): Likewise.
+       (htab_hash_string): Likewise.
+       (iterative_hash): Likewise.
+       (hash_pointer): Likewise.
+       * memchr.c (memchr): Likewise.
+       * memcmp.c (memcmp): Likewise.
+       * memcpy.c (memcpy): Likewise.
+       * memmove.c (memmove): Likewise.
+       * mempcpy.c (memcpy): Likewise.
+       (mempcpy): Likewise.
+       * memset.c (memset): Likewise.
+       * objalloc.c (malloc): Likewise.
+       (free): Likewise.
+       (objalloc_create): Likewise.
+       (_objalloc_alloc): Likewise.
+       (objalloc_free_block): Likewise.
+       * random.c (PTR): Likewise.
+       (void): Likewise.
+       (initstate): Likewise.
+       (setstate): Likewise.
+       * regex.c: Likewise.
+       * spaces.c (malloc): Likewise.
+       (free): Likewise.
+       * stpcpy.c (memcpy): Likewise.
+       * strdup.c (malloc): Likewise.
+       (memcpy): Likewise.
+       * strerror.c (malloc): Likewise.
+       (memset): Likewise.
+       * strndup.c (malloc): Likewise.
+       (memcpy): Likewise.
+       * strsignal.c (malloc): Likewise.
+       (memset): Likewise.
+       * vasprintf.c (malloc): Likewise.
+       * vprintf-support.c: Likewise.
+       * xatexit.c (malloc): Likewise.
+       * xmalloc.c (xmalloc): Likewise.
+       (xcalloc): Likewise.
+       (xrealloc): Likewise.
+       * xmemdup.c (xmemdup): Likewise.
+
+2022-03-19  Tiezhu Yang  <yangtiezhu@loongson.cn>
+
+       * floatformat.c (floatformat_ieee_quad_big): Renamed from
+       floatformat_ia64_quad_big.
+       (floatformat_ieee_quad_little): Similarly.
+
+2022-02-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR lto/104617
+       * simple-object-elf.c (simple_object_elf_match): Fix up URL
+       in comment.
+       (simple_object_elf_copy_lto_debug_sections): Remap sh_info and
+       sh_link even if they are in the SHN_LORESERVE .. SHN_HIRESERVE
+       range (inclusive).
+
+2022-02-17  Mark Wielaard  <mark@klomp.org>
+
+       * rust-demangle.c (rust_demangle_callback): Ignore everything
+       after '.' char in sym for v0. For legacy symbols search
+       backwards to find the last 'E' before any '.'.
+       * testsuite/rust-demangle-expected: Add new .suffix testcases.
+
 2022-01-31  Nick Clifton  <nickc@redhat.com>
 
-       PR 98886
-       PR 99935
+       PR demangler/98886
+       PR demangler/99935
        * rust-demangle.c (struct rust_demangler): Add a recursion
        counter.
        (demangle_path): Increment/decrement the recursion counter upon
 
        * regex.c: Suppress -Wuse-after-free.
 
-2022-01-22  Nick Clifton  <nickc@redhat.com>
-
-       * 2.38 release branch created.
-
 2021-12-30  Lancelot SIX  <lsix@lancelotsix.com>
 
        * cp-demangle.c (d_clone_suffix): Support digits in clone tag
index e09ddd91e584f8d6947f27aa6680848840cb7277..306c07bd37e9245c71b30871f103226bae4bceb9 100755 (executable)
@@ -2461,6 +2461,7 @@ 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
index f59f35e1f208cb493a0696faac9c0ea836f09263..6c1ff9c60933a95a150334652061cd649457eebc 100644 (file)
@@ -2,6 +2,7 @@ dnl Process this file with autoconf to produce a configure script
 
 AC_INIT
 AC_CONFIG_SRCDIR([xmalloc.c])
+AC_CONFIG_MACRO_DIRS([../config])
 
 # This works around the fact that libtool configuration may change LD
 # for this particular configuration, but some shells, instead of
index bb58d900e2760c88ecda2f547baa7a51d8697cf3..d6daf23af27a80ae0dbad5f04c43e86a0ecce60c 100644 (file)
@@ -126,7 +126,7 @@ parse_integer_62 (struct rust_demangler *rdm)
     return 0;
 
   x = 0;
-  while (!eat (rdm, '_'))
+  while (!eat (rdm, '_') && !rdm->errored)
     {
       c = next (rdm);
       x *= 62;
@@ -1082,6 +1082,18 @@ demangle_path_maybe_open_generics (struct rust_demangler *rdm)
   if (rdm->errored)
     return open;
 
+  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
+    {
+      ++ rdm->recursion;
+      if (rdm->recursion > RUST_MAX_RECURSION_COUNT)
+       {
+         /* FIXME: There ought to be a way to report
+            that the recursion limit has been reached.  */
+         rdm->errored = 1;
+         goto end_of_func;
+       }
+    }
+
   if (eat (rdm, 'B'))
     {
       backref = parse_integer_62 (rdm);
@@ -1107,6 +1119,11 @@ demangle_path_maybe_open_generics (struct rust_demangler *rdm)
     }
   else
     demangle_path (rdm, 0);
+
+ end_of_func:
+  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
+    -- rdm->recursion;
+
   return open;
 }
 
@@ -1148,6 +1165,15 @@ demangle_const (struct rust_demangler *rdm)
   if (rdm->errored)
     return;
 
+  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
+    {
+      ++ rdm->recursion;
+      if (rdm->recursion > RUST_MAX_RECURSION_COUNT)
+       /* FIXME: There ought to be a way to report
+          that the recursion limit has been reached.  */
+       goto fail_return;
+    }
+
   if (eat (rdm, 'B'))
     {
       backref = parse_integer_62 (rdm);
@@ -1158,7 +1184,7 @@ demangle_const (struct rust_demangler *rdm)
           demangle_const (rdm);
           rdm->next = old_next;
         }
-      return;
+      goto pass_return;
     }
 
   ty_tag = next (rdm);
@@ -1167,7 +1193,7 @@ demangle_const (struct rust_demangler *rdm)
     /* Placeholder. */
     case 'p':
       PRINT ("_");
-      return;
+      goto pass_return;
 
     /* Unsigned integer types. */
     case 'h':
@@ -1200,18 +1226,20 @@ demangle_const (struct rust_demangler *rdm)
       break;
 
     default:
-      rdm->errored = 1;
-      return;
+      goto fail_return;
     }
 
-  if (rdm->errored)
-    return;
-
-  if (rdm->verbose)
+  if (!rdm->errored && rdm->verbose)
     {
       PRINT (": ");
       PRINT (basic_type (ty_tag));
     }
+
+ fail_return:
+  rdm->errored = 1;
+ pass_return:
+  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
+    -- rdm->recursion;
 }
 
 static void