From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2124) id E06D238582A7; Mon, 4 Jul 2022 12:57:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E06D238582A7 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Nick Clifton To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] Synchronize libbierty sources with gcc. X-Act-Checkin: binutils-gdb X-Git-Author: Nick Clifton X-Git-Refname: refs/heads/master X-Git-Oldrev: 407115429b349a55561213a61e910756c965f902 X-Git-Newrev: d8efadbdd94772562fed8fba9ce553587a62550f Message-Id: <20220704125727.E06D238582A7@sourceware.org> Date: Mon, 4 Jul 2022 12:57:27 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2022 12:57:28 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dd8efadbdd947= 72562fed8fba9ce553587a62550f commit d8efadbdd94772562fed8fba9ce553587a62550f Author: Nick Clifton Date: Mon Jul 4 13:57:12 2022 +0100 Synchronize libbierty sources with gcc. Diff: --- ChangeLog | 13 +++++ libiberty/ChangeLog | 146 ++++++++++++++++++++++++++++++++++++++++++= ++-- libiberty/configure | 1 + libiberty/configure.ac | 1 + libiberty/rust-demangle.c | 46 ++++++++++++--- 5 files changed, 192 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6b3e58b8f0..59f70817924 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2022-07-04 Nick Clifton + + * libiberty: Synchronize with GCC. Bring in: + 2022-07-01 Nick Clifton + + PR demangler/105039 + * rust-demangle.c (demangle_const): Add recursion limit. + + 2022-06-26 Simon Marchi + + * configure.ac: Add AC_CONFIG_MACRO_DIRS call. + * configure: Re-generate. + 2022-04-12 Nick Clifton =20 * zlib: Rebase to the 1.2.12 release. diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index de3a6eeef52..f84e4076ee5 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,7 +1,145 @@ +2022-07-01 Nick Clifton + + PR demangler/105039 + * rust-demangle.c (demangle_const): Add recursion limit. + +2022-06-26 Simon Marchi + + * configure.ac: Add AC_CONFIG_MACRO_DIRS call. + * configure: Re-generate. + +2022-05-23 Nathan Sidwell + + * 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 ca= llers. + (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 + + * 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 + + * 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 + + * regex.c: Restore comments. + +2022-05-10 Martin Liska + Alan Modra + + * hashtab.c (htab_empty): Use void * type instead of void **. + (htab_expand): Likewise. + +2022-05-10 Martin Liska + + * random.c: Remove 'define PTR'. + +2022-05-10 Martin Liska + + * 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 + + * floatformat.c (floatformat_ieee_quad_big): Renamed from + floatformat_ia64_quad_big. + (floatformat_ieee_quad_little): Similarly. + +2022-02-22 Jakub Jelinek + + 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 + + * 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 =20 - 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 @@ -14,10 +152,6 @@ =20 * regex.c: Suppress -Wuse-after-free. =20 -2022-01-22 Nick Clifton - - * 2.38 release branch created. - 2021-12-30 Lancelot SIX =20 * cp-demangle.c (d_clone_suffix): Support digits in clone tag diff --git a/libiberty/configure b/libiberty/configure index e09ddd91e58..306c07bd37e 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -2461,6 +2461,7 @@ ac_compiler_gnu=3D$ac_cv_c_compiler_gnu =20 =20 =20 + # 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 diff --git a/libiberty/configure.ac b/libiberty/configure.ac index f59f35e1f20..6c1ff9c6093 100644 --- a/libiberty/configure.ac +++ b/libiberty/configure.ac @@ -2,6 +2,7 @@ dnl Process this file with autoconf to produce a configure = script =20 AC_INIT AC_CONFIG_SRCDIR([xmalloc.c]) +AC_CONFIG_MACRO_DIRS([../config]) =20 # This works around the fact that libtool configuration may change LD # for this particular configuration, but some shells, instead of diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c index bb58d900e27..d6daf23af27 100644 --- a/libiberty/rust-demangle.c +++ b/libiberty/rust-demangle.c @@ -126,7 +126,7 @@ parse_integer_62 (struct rust_demangler *rdm) return 0; =20 x =3D 0; - while (!eat (rdm, '_')) + while (!eat (rdm, '_') && !rdm->errored) { c =3D next (rdm); x *=3D 62; @@ -1082,6 +1082,18 @@ demangle_path_maybe_open_generics (struct rust_deman= gler *rdm) if (rdm->errored) return open; =20 + if (rdm->recursion !=3D 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 =3D 1; + goto end_of_func; + } + } + if (eat (rdm, 'B')) { backref =3D parse_integer_62 (rdm); @@ -1107,6 +1119,11 @@ demangle_path_maybe_open_generics (struct rust_deman= gler *rdm) } else demangle_path (rdm, 0); + + end_of_func: + if (rdm->recursion !=3D RUST_NO_RECURSION_LIMIT) + -- rdm->recursion; + return open; } =20 @@ -1148,6 +1165,15 @@ demangle_const (struct rust_demangler *rdm) if (rdm->errored) return; =20 + if (rdm->recursion !=3D 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 =3D parse_integer_62 (rdm); @@ -1158,7 +1184,7 @@ demangle_const (struct rust_demangler *rdm) demangle_const (rdm); rdm->next =3D old_next; } - return; + goto pass_return; } =20 ty_tag =3D next (rdm); @@ -1167,7 +1193,7 @@ demangle_const (struct rust_demangler *rdm) /* Placeholder. */ case 'p': PRINT ("_"); - return; + goto pass_return; =20 /* Unsigned integer types. */ case 'h': @@ -1200,18 +1226,20 @@ demangle_const (struct rust_demangler *rdm) break; =20 default: - rdm->errored =3D 1; - return; + goto fail_return; } =20 - if (rdm->errored) - return; - - if (rdm->verbose) + if (!rdm->errored && rdm->verbose) { PRINT (": "); PRINT (basic_type (ty_tag)); } + + fail_return: + rdm->errored =3D 1; + pass_return: + if (rdm->recursion !=3D RUST_NO_RECURSION_LIMIT) + -- rdm->recursion; } =20 static void