diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2021-09-13 19:49:49 +0200 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2021-09-13 19:49:49 +0200 |
commit | b18a97e5dd0935e1c4a626c230f21457d0aad3d5 (patch) | |
tree | c1818f41af6fe780deafb6cd6a183f32085fe654 /libiberty | |
parent | e76a53644c9d70e998c0d050e9a456af388c6b61 (diff) | |
download | gcc-b18a97e5dd0935e1c4a626c230f21457d0aad3d5.zip gcc-b18a97e5dd0935e1c4a626c230f21457d0aad3d5.tar.gz gcc-b18a97e5dd0935e1c4a626c230f21457d0aad3d5.tar.bz2 |
Merged current trunk to branch.
Diffstat (limited to 'libiberty')
100 files changed, 662 insertions, 334 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 65a0a71..7c337c2 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,123 @@ +2021-09-01 Iain Sandoe <iain@sandoe.co.uk> + + * configure: Regenerate. + * configure.ac: Do not search for sbrk on Darwin. + * xmalloc.c: Do not declare sbrk unless it has been found + by configure. + +2021-08-29 Iain Buclaw <ibuclaw@gdcproject.org> + + * d-demangle.c (dlang_identifier): Skip over fake parent manglings. + * testsuite/d-demangle-expected: Add tests. + +2021-08-29 Iain Buclaw <ibuclaw@gdcproject.org> + + * d-demangle.c (dlang_parse_arrayliteral): Add 'info' parameter. + (dlang_parse_assocarray): Likewise. + (dlang_parse_structlit): Likewise. + (dlang_value): Likewise. Handle function literal symbols. + (dlang_template_args): Pass 'info' to dlang_value. + * testsuite/d-demangle-expected: Add new test. + +2021-08-29 Iain Buclaw <ibuclaw@gdcproject.org> + + * d-demangle.c (dlang_attributes): Handle typeof(*null). + (dlang_type): Likewise. Demangle 'n' as typeof(null). + * testsuite/d-demangle-expected: Update tests. + +2021-08-23 Iain Sandoe <iain@sandoe.co.uk> + + * simple-object-mach-o.c (simple_object_mach_o_write_segment): + Cast the first argument to set_32 as needed. + +2021-08-18 Iain Sandoe <iain@sandoe.co.uk> + + * simple-object-mach-o.c (simple_object_mach_o_write_segment): + Arrange to swap the LTO index tables where needed. + +2021-06-30 Gerald Pfeifer <gerald@pfeifer.com> + + * make-temp-file.c (usrtmp): Remove. + (choose_tmpdir): Remove use of usrtmp. + +2021-06-28 Indu Bhagat <indu.bhagat@oracle.com> + + * 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-05-06 Tom Tromey <tom@tromey.com> + + * 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. + 2020-12-22 Jason Merrill <jason@redhat.com> PR c++/67343 diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index 895f701..4f1213b 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -1,7 +1,7 @@ # Makefile for the libiberty library. # Originally written by K. Richard Pixley <rich@cygnus.com>. # -# Copyright (C) 1990-2020 Free Software Foundation, Inc. +# Copyright (C) 1990-2021 Free Software Foundation, Inc. # # This file is part of the libiberty library. # Libiberty is free software; you can redistribute it and/or @@ -481,18 +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/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/_doprnt.c b/libiberty/_doprnt.c index a739f43..f91d80d 100644 --- a/libiberty/_doprnt.c +++ b/libiberty/_doprnt.c @@ -1,5 +1,5 @@ /* Provide a version of _doprnt in terms of fprintf. - Copyright (C) 1998-2020 Free Software Foundation, Inc. + Copyright (C) 1998-2021 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 --git a/libiberty/acinclude.m4 b/libiberty/acinclude.m4 new file mode 100644 index 0000000..6db0e50 --- /dev/null +++ b/libiberty/acinclude.m4 @@ -0,0 +1,185 @@ +dnl Copyright (C) 2000-2021 Free Software Foundation, Inc. +dnl +dnl GCC is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3, or (at your option) +dnl any later version. +dnl +dnl GCC is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with GCC; see the file COPYING3. If not see +dnl <http://www.gnu.org/licenses/>. + +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]) +]) diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 index 34c0a5b..3378316 100644 --- a/libiberty/aclocal.m4 +++ b/libiberty/aclocal.m4 @@ -1,177 +1,21 @@ -sinclude(../config/acx.m4) -sinclude(../config/cet.m4) -sinclude(../config/enable.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 6a72208..48dcd10 100644 --- a/libiberty/argv.c +++ b/libiberty/argv.c @@ -1,5 +1,5 @@ /* Create and destroy argument vectors (argv's) - Copyright (C) 1992-2020 Free Software Foundation, Inc. + Copyright (C) 1992-2021 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support This file is part of the libiberty library. @@ -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/asprintf.c b/libiberty/asprintf.c index 6e38e22..5f291f2 100644 --- a/libiberty/asprintf.c +++ b/libiberty/asprintf.c @@ -1,6 +1,6 @@ /* Like sprintf but provides a pointer to malloc'd storage, which must be freed by the caller. - Copyright (C) 1997-2020 Free Software Foundation, Inc. + Copyright (C) 1997-2021 Free Software Foundation, Inc. Contributed by Cygnus Solutions. This file is part of the libiberty library. diff --git a/libiberty/choose-temp.c b/libiberty/choose-temp.c index 49a2faa..fefdb9b 100644 --- a/libiberty/choose-temp.c +++ b/libiberty/choose-temp.c @@ -1,5 +1,5 @@ /* Utility to pick a temporary filename prefix. - Copyright (C) 1996-2020 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/clock.c b/libiberty/clock.c index 0de7465..648a716 100644 --- a/libiberty/clock.c +++ b/libiberty/clock.c @@ -1,5 +1,5 @@ /* ANSI-compatible clock function. - Copyright (C) 1994-2020 Free Software Foundation, Inc. + Copyright (C) 1994-2021 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 --git a/libiberty/concat.c b/libiberty/concat.c index 533e4a9..f07202f 100644 --- a/libiberty/concat.c +++ b/libiberty/concat.c @@ -1,5 +1,5 @@ /* Concatenate variable number of strings. - Copyright (C) 1991-2020 Free Software Foundation, Inc. + Copyright (C) 1991-2021 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support This file is part of the libiberty library. diff --git a/libiberty/configure b/libiberty/configure index b6af9ba..3c7e588 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -2458,9 +2458,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 @@ -5399,6 +5396,34 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +int +main () +{ + asm ("endbr32"); + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + have_multi_byte_nop=yes +else + have_multi_byte_nop=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + have_cet=no + if test x$have_multi_byte_nop = xyes; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + static void foo (void) { @@ -5435,6 +5460,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi if test x$enable_cet = xno -a x$have_cet = xyes; then as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 fi @@ -5991,9 +6017,16 @@ vars="sys_errlist sys_nerr sys_siglist" checkfuncs="__fsetlocking canonicalize_file_name dup3 getrlimit getrusage \ getsysinfo gettimeofday on_exit pipe2 psignal pstat_getdynamic pstat_getstatic \ - realpath setrlimit sbrk spawnve spawnvpe strerror strsignal sysconf sysctl \ + realpath setrlimit spawnve spawnvpe strerror strsignal sysconf sysctl \ sysmp table times wait3 wait4" +# Darwin has sbrk, but it is deprecated and that produces build-time warnings +# so do not check for it. +case "${host}" in + *-*-darwin*) ;; + *) checkfuncs="$checkfuncs sbrk" +esac + # These are neither executed nor required, but they help keep # autoheader happy without adding a bunch of text to acconfig.h. if test "x" = "y"; then @@ -6562,6 +6595,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. @@ -7023,11 +7072,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; } @@ -7206,7 +7255,10 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_REALLOC $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "sbrk" "ac_cv_have_decl_sbrk" "$ac_includes_default" + + case "${host}" in + *-*-darwin*) ;; # Darwin's sbrk implementation is deprecated. + *) ac_fn_c_check_decl "$LINENO" "sbrk" "ac_cv_have_decl_sbrk" "$ac_includes_default" if test "x$ac_cv_have_decl_sbrk" = xyes; then : ac_have_decl=1 else @@ -7216,7 +7268,8 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SBRK $ac_have_decl _ACEOF - +;; + esac ac_fn_c_check_decl "$LINENO" "strtol" "ac_cv_have_decl_strtol" "$ac_includes_default" if test "x$ac_cv_have_decl_strtol" = xyes; then : ac_have_decl=1 diff --git a/libiberty/configure.ac b/libiberty/configure.ac index ad95296..4b78c18 100644 --- a/libiberty/configure.ac +++ b/libiberty/configure.ac @@ -395,9 +395,16 @@ vars="sys_errlist sys_nerr sys_siglist" checkfuncs="__fsetlocking canonicalize_file_name dup3 getrlimit getrusage \ getsysinfo gettimeofday on_exit pipe2 psignal pstat_getdynamic pstat_getstatic \ - realpath setrlimit sbrk spawnve spawnvpe strerror strsignal sysconf sysctl \ + realpath setrlimit spawnve spawnvpe strerror strsignal sysconf sysctl \ sysmp table times wait3 wait4" +# Darwin has sbrk, but it is deprecated and that produces build-time warnings +# so do not check for it. +case "${host}" in + *-*-darwin*) ;; + *) checkfuncs="$checkfuncs sbrk" +esac + # These are neither executed nor required, but they help keep # autoheader happy without adding a bunch of text to acconfig.h. if test "x" = "y"; then @@ -611,6 +618,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. @@ -665,7 +678,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 @@ -689,7 +702,11 @@ if test -z "${setobjs}"; then AC_CHECK_FUNCS($checkfuncs) AC_CHECK_DECLS([basename(char *), ffs, asprintf, vasprintf, snprintf, vsnprintf]) - AC_CHECK_DECLS([calloc, getenv, getopt, malloc, realloc, sbrk]) + AC_CHECK_DECLS([calloc, getenv, getopt, malloc, realloc]) + case "${host}" in + *-*-darwin*) ;; # Darwin's sbrk implementation is deprecated. + *) AC_CHECK_DECLS([sbrk]);; + esac AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoull]) AC_CHECK_DECLS([strverscmp]) AC_CHECK_DECLS([strnlen]) diff --git a/libiberty/copying-lib.texi b/libiberty/copying-lib.texi index ce1cb03..88df06a 100644 --- a/libiberty/copying-lib.texi +++ b/libiberty/copying-lib.texi @@ -5,7 +5,7 @@ @center Version 2.1, February 1999 @display -Copyright @copyright{} 1991-2020 Free Software Foundation, Inc. +Copyright @copyright{} 1991-2021 Free Software Foundation, Inc. 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 5242727..33490f6 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -1,5 +1,5 @@ /* Demangler for g++ V3 ABI. - Copyright (C) 2003-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2021 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. @@ -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/cp-demangle.h b/libiberty/cp-demangle.h index 27014cd..cb47bdf 100644 --- a/libiberty/cp-demangle.h +++ b/libiberty/cp-demangle.h @@ -1,5 +1,5 @@ /* Internal demangler interface for g++ V3 ABI. - Copyright (C) 2003-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2021 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 --git a/libiberty/cp-demint.c b/libiberty/cp-demint.c index 6e41bad..9d392cc 100644 --- a/libiberty/cp-demint.c +++ b/libiberty/cp-demint.c @@ -1,5 +1,5 @@ /* Demangler component interface functions. - Copyright (C) 2004-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2021 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 --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c index fb0673d..5f8cd3d 100644 --- a/libiberty/cplus-dem.c +++ b/libiberty/cplus-dem.c @@ -1,5 +1,5 @@ /* Demangler for GNU C++ - Copyright (C) 1989-2020 Free Software Foundation, Inc. + Copyright (C) 1989-2021 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 --git a/libiberty/crc32.c b/libiberty/crc32.c index 8f7832a..50eb8ec 100644 --- a/libiberty/crc32.c +++ b/libiberty/crc32.c @@ -1,5 +1,5 @@ /* crc32.c - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. This file is part of the libiberty library. diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c index cd3bc96..a2152cc 100644 --- a/libiberty/d-demangle.c +++ b/libiberty/d-demangle.c @@ -1,5 +1,5 @@ /* Demangler for the D programming language - Copyright (C) 2014-2020 Free Software Foundation, Inc. + Copyright (C) 2014-2021 Free Software Foundation, Inc. Written by Iain Buclaw (ibuclaw@gdcproject.org) This file is part of the libiberty library. @@ -191,7 +191,8 @@ static const char *dlang_function_args (string *, const char *, static const char *dlang_type (string *, const char *, struct dlang_info *); -static const char *dlang_value (string *, const char *, const char *, char); +static const char *dlang_value (string *, const char *, const char *, char, + struct dlang_info *); static const char *dlang_parse_qualified (string *, const char *, struct dlang_info *, int); @@ -573,9 +574,11 @@ dlang_attributes (string *decl, const char *mangled) case 'g': case 'h': case 'k': + case 'n': /* inout parameter is represented as 'Ng'. vector parameter is represented as 'Nh'. - return paramenter is represented as 'Nk'. + return parameter is represented as 'Nk'. + typeof(*null) parameter is represented as 'Nn'. If we see this, then we know we're really in the parameter list. Rewind and break. */ mangled--; @@ -787,6 +790,12 @@ dlang_type (string *decl, const char *mangled, struct dlang_info *info) string_append (decl, ")"); return mangled; } + else if (*mangled == 'n') /* typeof(*null) */ + { + mangled++; + string_append (decl, "typeof(*null)"); + return mangled; + } else return NULL; case 'A': /* dynamic array (T[]) */ @@ -884,7 +893,7 @@ dlang_type (string *decl, const char *mangled, struct dlang_info *info) /* Basic types */ case 'n': mangled++; - string_append (decl, "none"); + string_append (decl, "typeof(null)"); return mangled; case 'v': mangled++; @@ -1035,6 +1044,25 @@ dlang_identifier (string *decl, const char *mangled, struct dlang_info *info) && (mangled[2] == 'T' || mangled[2] == 'U')) return dlang_parse_template (decl, mangled, info, len); + /* There can be multiple different declarations in the same function that have + the same mangled name. To make the mangled names unique, a fake parent in + the form `__Sddd' is added to the symbol. */ + if (len >= 4 && mangled[0] == '_' && mangled[1] == '_' && mangled[2] == 'S') + { + const char *numptr = mangled + 3; + while (numptr < (mangled + len) && ISDIGIT (*numptr)) + numptr++; + + if (mangled + len == numptr) + { + /* Skip over the fake parent. */ + mangled += len; + return dlang_identifier (decl, mangled, info); + } + + /* else demangle it as a plain identifier. */ + } + return dlang_lname (decl, mangled, len); } @@ -1378,7 +1406,8 @@ dlang_parse_string (string *decl, const char *mangled) /* Extract the static array value from MANGLED and append it to DECL. Return the remaining string on success or NULL on failure. */ static const char * -dlang_parse_arrayliteral (string *decl, const char *mangled) +dlang_parse_arrayliteral (string *decl, const char *mangled, + struct dlang_info *info) { unsigned long elements; @@ -1389,7 +1418,7 @@ dlang_parse_arrayliteral (string *decl, const char *mangled) string_append (decl, "["); while (elements--) { - mangled = dlang_value (decl, mangled, NULL, '\0'); + mangled = dlang_value (decl, mangled, NULL, '\0', info); if (mangled == NULL) return NULL; @@ -1404,7 +1433,8 @@ dlang_parse_arrayliteral (string *decl, const char *mangled) /* Extract the associative array value from MANGLED and append it to DECL. Return the remaining string on success or NULL on failure. */ static const char * -dlang_parse_assocarray (string *decl, const char *mangled) +dlang_parse_assocarray (string *decl, const char *mangled, + struct dlang_info *info) { unsigned long elements; @@ -1415,12 +1445,12 @@ dlang_parse_assocarray (string *decl, const char *mangled) string_append (decl, "["); while (elements--) { - mangled = dlang_value (decl, mangled, NULL, '\0'); + mangled = dlang_value (decl, mangled, NULL, '\0', info); if (mangled == NULL) return NULL; string_append (decl, ":"); - mangled = dlang_value (decl, mangled, NULL, '\0'); + mangled = dlang_value (decl, mangled, NULL, '\0', info); if (mangled == NULL) return NULL; @@ -1435,7 +1465,8 @@ dlang_parse_assocarray (string *decl, const char *mangled) /* Extract the struct literal value for NAME from MANGLED and append it to DECL. Return the remaining string on success or NULL on failure. */ static const char * -dlang_parse_structlit (string *decl, const char *mangled, const char *name) +dlang_parse_structlit (string *decl, const char *mangled, const char *name, + struct dlang_info *info) { unsigned long args; @@ -1449,7 +1480,7 @@ dlang_parse_structlit (string *decl, const char *mangled, const char *name) string_append (decl, "("); while (args--) { - mangled = dlang_value (decl, mangled, NULL, '\0'); + mangled = dlang_value (decl, mangled, NULL, '\0', info); if (mangled == NULL) return NULL; @@ -1464,7 +1495,8 @@ dlang_parse_structlit (string *decl, const char *mangled, const char *name) /* Extract the value from MANGLED and append it to DECL. Return the remaining string on success or NULL on failure. */ static const char * -dlang_value (string *decl, const char *mangled, const char *name, char type) +dlang_value (string *decl, const char *mangled, const char *name, char type, + struct dlang_info *info) { if (mangled == NULL || *mangled == '\0') return NULL; @@ -1525,15 +1557,24 @@ dlang_value (string *decl, const char *mangled, const char *name, char type) case 'A': mangled++; if (type == 'H') - mangled = dlang_parse_assocarray (decl, mangled); + mangled = dlang_parse_assocarray (decl, mangled, info); else - mangled = dlang_parse_arrayliteral (decl, mangled); + mangled = dlang_parse_arrayliteral (decl, mangled, info); break; /* Struct values. */ case 'S': mangled++; - mangled = dlang_parse_structlit (decl, mangled, name); + mangled = dlang_parse_structlit (decl, mangled, name, info); + break; + + /* Function literal symbol. */ + case 'f': + mangled++; + if (strncmp (mangled, "_D", 2) != 0 + || !dlang_symbol_name_p (mangled + 2, info)) + return NULL; + mangled = dlang_parse_mangle (decl, mangled, info); break; default: @@ -1806,7 +1847,7 @@ dlang_template_args (string *decl, const char *mangled, struct dlang_info *info) string_need (&name, 1); *(name.p) = '\0'; - mangled = dlang_value (decl, mangled, name.b, type); + mangled = dlang_value (decl, mangled, name.b, type, info); string_delete (&name); break; } diff --git a/libiberty/dwarfnames.c b/libiberty/dwarfnames.c index af11668..630d841 100644 --- a/libiberty/dwarfnames.c +++ b/libiberty/dwarfnames.c @@ -1,5 +1,5 @@ /* Names of various DWARF tags. - Copyright (C) 2012-2020 Free Software Foundation, Inc. + Copyright (C) 2012-2021 Free Software Foundation, Inc. This file is part of GNU CC. diff --git a/libiberty/dyn-string.c b/libiberty/dyn-string.c index e10f691..8d2456b 100644 --- a/libiberty/dyn-string.c +++ b/libiberty/dyn-string.c @@ -1,5 +1,5 @@ /* An abstract string datatype. - Copyright (C) 1998-2020 Free Software Foundation, Inc. + Copyright (C) 1998-2021 Free Software Foundation, Inc. Contributed by Mark Mitchell (mark@markmitchell.com). This file is part of GNU CC. @@ -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/fdmatch.c b/libiberty/fdmatch.c index 31803e4..fd963f8 100644 --- a/libiberty/fdmatch.c +++ b/libiberty/fdmatch.c @@ -1,5 +1,5 @@ /* Compare two open file descriptors to see if they refer to the same file. - Copyright (C) 1991-2020 Free Software Foundation, Inc. + Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/fibheap.c b/libiberty/fibheap.c index b897228..cabde62 100644 --- a/libiberty/fibheap.c +++ b/libiberty/fibheap.c @@ -1,5 +1,5 @@ /* A Fibonacci heap datatype. - Copyright (C) 1998-2020 Free Software Foundation, Inc. + Copyright (C) 1998-2021 Free Software Foundation, Inc. Contributed by Daniel Berlin (dan@cgsoftware.com). This file is part of GNU CC. diff --git a/libiberty/filedescriptor.c b/libiberty/filedescriptor.c index ba2e87c..e613027 100644 --- a/libiberty/filedescriptor.c +++ b/libiberty/filedescriptor.c @@ -1,6 +1,6 @@ /* File descriptor related functions. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 Free Software Foundation, Inc. This file is part of the libiberty library. diff --git a/libiberty/filename_cmp.c b/libiberty/filename_cmp.c index 68fb06f..f13b0f5 100644 --- a/libiberty/filename_cmp.c +++ b/libiberty/filename_cmp.c @@ -1,6 +1,6 @@ /* File name comparison routine. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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 --git a/libiberty/floatformat.c b/libiberty/floatformat.c index 6b9b032..4feab3b 100644 --- a/libiberty/floatformat.c +++ b/libiberty/floatformat.c @@ -1,5 +1,5 @@ /* IEEE floating point support routines, for GDB, the GNU Debugger. - Copyright (C) 1991-2020 Free Software Foundation, Inc. + Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of GDB. diff --git a/libiberty/fnmatch.c b/libiberty/fnmatch.c index 7be51ae..6c11ad0 100644 --- a/libiberty/fnmatch.c +++ b/libiberty/fnmatch.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. NOTE: This source is derived from an old version taken from the GNU C Library (glibc). diff --git a/libiberty/fopen_unlocked.c b/libiberty/fopen_unlocked.c index b8c426b..fc27568 100644 --- a/libiberty/fopen_unlocked.c +++ b/libiberty/fopen_unlocked.c @@ -1,5 +1,5 @@ /* Implement fopen_unlocked and related functions. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>. This file is part of the libiberty library. diff --git a/libiberty/gather-docs b/libiberty/gather-docs index 01f1e0b..400eb54 100644 --- a/libiberty/gather-docs +++ b/libiberty/gather-docs @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- perl -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is part of the libiberty library. # Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/getopt.c b/libiberty/getopt.c index 7119b62..5d9bcaa 100644 --- a/libiberty/getopt.c +++ b/libiberty/getopt.c @@ -3,7 +3,7 @@ "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! - Copyright (C) 1987-2020 Free Software Foundation, Inc. + Copyright (C) 1987-2021 Free Software Foundation, Inc. NOTE: This source is derived from an old version taken from the GNU C Library (glibc). diff --git a/libiberty/getopt1.c b/libiberty/getopt1.c index 8724247..3d24d2b 100644 --- a/libiberty/getopt1.c +++ b/libiberty/getopt1.c @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987-2020 Free Software Foundation, Inc. + Copyright (C) 1987-2021 Free Software Foundation, Inc. NOTE: This source is derived from an old version taken from the GNU C Library (glibc). diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c index f9f7841..951c3fe 100644 --- a/libiberty/getruntime.c +++ b/libiberty/getruntime.c @@ -1,5 +1,5 @@ /* Return time used so far, in microseconds. - Copyright (C) 1994-2020 Free Software Foundation, Inc. + Copyright (C) 1994-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 225e9e5..7c424e8 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -1,5 +1,5 @@ /* An expandable hash tables datatype. - Copyright (C) 1999-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2021 Free Software Foundation, Inc. Contributed by Vladimir Makarov (vmakarov@cygnus.com). This file is part of the libiberty library. @@ -841,6 +841,13 @@ htab_hash_string (const PTR p) return r; } +/* An equality function for null-terminated strings. */ +int +htab_eq_string (const void *a, const void *b) +{ + return strcmp ((const char *) a, (const char *) b) == 0; +} + /* DERIVED FROM: -------------------------------------------------------------------- lookup2.c, by Bob Jenkins, December 1996, Public Domain. diff --git a/libiberty/hex.c b/libiberty/hex.c index f2b57e3..76fb33f 100644 --- a/libiberty/hex.c +++ b/libiberty/hex.c @@ -1,5 +1,5 @@ /* Hex character manipulation support. - Copyright (C) 1995-2020 Free Software Foundation, Inc. + Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/lbasename.c b/libiberty/lbasename.c index 6715b20..8bed46f 100644 --- a/libiberty/lbasename.c +++ b/libiberty/lbasename.c @@ -1,6 +1,6 @@ /* Libiberty basename. Like basename, but is not overridden by the system C library. - Copyright (C) 2001-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/libiberty.texi b/libiberty/libiberty.texi index 01751be..d71b455 100644 --- a/libiberty/libiberty.texi +++ b/libiberty/libiberty.texi @@ -24,7 +24,7 @@ @ifinfo This manual describes the GNU @libib library of utility subroutines. -Copyright @copyright{} 2001-2020 Free Software Foundation, Inc. +Copyright @copyright{} 2001-2021 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 the removal of this paragraph @vskip 0pt plus 1filll -Copyright @copyright{} 2001-2020 Free Software Foundation, Inc. +Copyright @copyright{} 2001-2021 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 --git a/libiberty/lrealpath.c b/libiberty/lrealpath.c index d6694c4..83bdd17 100644 --- a/libiberty/lrealpath.c +++ b/libiberty/lrealpath.c @@ -1,7 +1,7 @@ /* Libiberty realpath. Like realpath, but more consistent behavior. Based on gdb_realpath from GDB. - Copyright (C) 2003-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2021 Free Software Foundation, Inc. This file is part of the libiberty library. diff --git a/libiberty/maint-tool b/libiberty/maint-tool index c27c3a4..9645030 100644 --- a/libiberty/maint-tool +++ b/libiberty/maint-tool @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- perl -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is part of the libiberty library. # Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c index e3f9f92..ef932ff 100644 --- a/libiberty/make-relative-prefix.c +++ b/libiberty/make-relative-prefix.c @@ -1,5 +1,5 @@ /* Relative (relocatable) prefix support. - Copyright (C) 1987-2020 Free Software Foundation, Inc. + Copyright (C) 1987-2021 Free Software Foundation, Inc. This file is part of libiberty. diff --git a/libiberty/make-temp-file.c b/libiberty/make-temp-file.c index cb08c27..31f87fb 100644 --- a/libiberty/make-temp-file.c +++ b/libiberty/make-temp-file.c @@ -1,5 +1,5 @@ /* Utility to pick a temporary filename prefix. - Copyright (C) 1996-2020 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or @@ -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/md5.c b/libiberty/md5.c index 755b8ff..a8c8de2 100644 --- a/libiberty/md5.c +++ b/libiberty/md5.c @@ -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-2020 Free Software Foundation, Inc. + Copyright (C) 1995-2021 Free Software Foundation, Inc. NOTE: This source is derived from an old version taken from the GNU C Library (glibc). diff --git a/libiberty/memmem.c b/libiberty/memmem.c index 1e26c8b..b86c6c1 100644 --- a/libiberty/memmem.c +++ b/libiberty/memmem.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 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 --git a/libiberty/mempcpy.c b/libiberty/mempcpy.c index a65a557..f4c624d 100644 --- a/libiberty/mempcpy.c +++ b/libiberty/mempcpy.c @@ -1,5 +1,5 @@ /* Implement the mempcpy function. - Copyright (C) 2003-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2021 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>. This file is part of the libiberty library. diff --git a/libiberty/mkstemps.c b/libiberty/mkstemps.c index 18d879a..342c828 100644 --- a/libiberty/mkstemps.c +++ b/libiberty/mkstemps.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 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 --git a/libiberty/objalloc.c b/libiberty/objalloc.c index 131598f..cf51905 100644 --- a/libiberty/objalloc.c +++ b/libiberty/objalloc.c @@ -1,5 +1,5 @@ /* objalloc.c -- routines to allocate memory for objects - Copyright (C) 1997-2020 Free Software Foundation, Inc. + Copyright (C) 1997-2021 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 --git a/libiberty/obstack.c b/libiberty/obstack.c index 0a4e57e..aa1173d 100644 --- a/libiberty/obstack.c +++ b/libiberty/obstack.c @@ -1,5 +1,5 @@ /* obstack.c - subroutines used implicitly by object stack macros - Copyright (C) 1988-2020 Free Software Foundation, Inc. + Copyright (C) 1988-2021 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 --git a/libiberty/partition.c b/libiberty/partition.c index 2e17515..81e5fc0 100644 --- a/libiberty/partition.c +++ b/libiberty/partition.c @@ -1,5 +1,5 @@ /* List implementation of a partition of consecutive integers. - Copyright (C) 2000-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2021 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. This file is part of GNU CC. diff --git a/libiberty/pex-common.c b/libiberty/pex-common.c index 30cd904..12a8695 100644 --- a/libiberty/pex-common.c +++ b/libiberty/pex-common.c @@ -1,5 +1,5 @@ /* Common code for executing a program in a sub-process. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@airs.com>. This file is part of the libiberty library. diff --git a/libiberty/pex-common.h b/libiberty/pex-common.h index 54dd1a1..5324c54 100644 --- a/libiberty/pex-common.h +++ b/libiberty/pex-common.h @@ -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-2020 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/pex-djgpp.c b/libiberty/pex-djgpp.c index 3511808..4d192d2 100644 --- a/libiberty/pex-djgpp.c +++ b/libiberty/pex-djgpp.c @@ -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-2020 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/pex-msdos.c b/libiberty/pex-msdos.c index 67a4733..d2ba3b9 100644 --- a/libiberty/pex-msdos.c +++ b/libiberty/pex-msdos.c @@ -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-2020 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/pex-one.c b/libiberty/pex-one.c index 2dcf6c0..2cee7f9 100644 --- a/libiberty/pex-one.c +++ b/libiberty/pex-one.c @@ -1,5 +1,5 @@ /* Execute a program and wait for a result. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c index 684a49a..8da2fdc 100644 --- a/libiberty/pex-unix.c +++ b/libiberty/pex-unix.c @@ -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-2020 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c index f5fafaa..ecfe7f1 100644 --- a/libiberty/pex-win32.c +++ b/libiberty/pex-win32.c @@ -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-2020 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/pexecute.c b/libiberty/pexecute.c index 2dfcdda..e501116 100644 --- a/libiberty/pexecute.c +++ b/libiberty/pexecute.c @@ -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-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/physmem.c b/libiberty/physmem.c index f942716..3dc8d9d 100644 --- a/libiberty/physmem.c +++ b/libiberty/physmem.c @@ -1,5 +1,5 @@ /* Calculate the size of physical memory. - Copyright (C) 2000-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2021 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 --git a/libiberty/putenv.c b/libiberty/putenv.c index f3ddf83..a78d67f 100644 --- a/libiberty/putenv.c +++ b/libiberty/putenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 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 --git a/libiberty/regex.c b/libiberty/regex.c index 7d20319..5531d87 100644 --- a/libiberty/regex.c +++ b/libiberty/regex.c @@ -3,7 +3,7 @@ (Implements POSIX draft P1003.2/D11.2, except for some of the internationalization features.) - Copyright (C) 1993-2020 Free Software Foundation, Inc. + Copyright (C) 1993-2021 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 --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c index 08c615f..449941b 100644 --- a/libiberty/rust-demangle.c +++ b/libiberty/rust-demangle.c @@ -1,5 +1,5 @@ /* Demangler for the Rust programming language - Copyright (C) 2016-2020 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. Written by David Tolnay (dtolnay@gmail.com). Rewritten by Eduard-Mihai Burtescu (eddyb@lyken.rs) for v0 support. @@ -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/safe-ctype.c b/libiberty/safe-ctype.c index 56364e6..3eeb33fd 100644 --- a/libiberty/safe-ctype.c +++ b/libiberty/safe-ctype.c @@ -1,6 +1,6 @@ /* <ctype.h> replacement macros. - Copyright (C) 2000-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2021 Free Software Foundation, Inc. Contributed by Zack Weinberg <zackw@stanford.edu>. This file is part of the libiberty library. diff --git a/libiberty/setenv.c b/libiberty/setenv.c index 82bf1b8..55d5502 100644 --- a/libiberty/setenv.c +++ b/libiberty/setenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2020 Free Software Foundation, Inc. +/* Copyright (C) 1992-2021 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 --git a/libiberty/setproctitle.c b/libiberty/setproctitle.c index 3de50f6..b87c302 100644 --- a/libiberty/setproctitle.c +++ b/libiberty/setproctitle.c @@ -1,5 +1,5 @@ /* Set the title of a process. - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/sha1.c b/libiberty/sha1.c index af08219..7d15d48 100644 --- a/libiberty/sha1.c +++ b/libiberty/sha1.c @@ -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-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2021 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 @@ -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-coff.c b/libiberty/simple-object-coff.c index 104cd56..22723e3 100644 --- a/libiberty/simple-object-coff.c +++ b/libiberty/simple-object-coff.c @@ -1,5 +1,5 @@ /* simple-object-coff.c -- routines to manipulate COFF object files. - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. This program is free software; you can redistribute it and/or modify it diff --git a/libiberty/simple-object-common.h b/libiberty/simple-object-common.h index 2e3f187..e4b704e 100644 --- a/libiberty/simple-object-common.h +++ b/libiberty/simple-object-common.h @@ -1,5 +1,5 @@ /* simple-object-common.h -- common structs for object file manipulation. - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c index 37e7334..a421177 100644 --- a/libiberty/simple-object-elf.c +++ b/libiberty/simple-object-elf.c @@ -1,5 +1,5 @@ /* simple-object-elf.c -- routines to manipulate ELF object files. - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. This program is free software; you can redistribute it and/or modify it diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c index 14f5342..a8869e7 100644 --- a/libiberty/simple-object-mach-o.c +++ b/libiberty/simple-object-mach-o.c @@ -1,5 +1,5 @@ /* simple-object-mach-o.c -- routines to manipulate Mach-O object files. - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. This program is free software; you can redistribute it and/or modify it @@ -1225,6 +1225,11 @@ simple_object_mach_o_write_segment (simple_object_write *sobj, int descriptor, index[4 * i] -= index[0]; index[0] = 0; + /* Swap the indices, if required. */ + + for (i = 0; i < (nsects_in * 4); ++i) + set_32 ((unsigned char *) &index[i], index[i]); + sechdr_offset += sechdrsize; /* Write out the section names. diff --git a/libiberty/simple-object-xcoff.c b/libiberty/simple-object-xcoff.c index d874de2..776d5dc 100644 --- a/libiberty/simple-object-xcoff.c +++ b/libiberty/simple-object-xcoff.c @@ -1,5 +1,5 @@ /* simple-object-coff.c -- routines to manipulate XCOFF object files. - Copyright (C) 2013-2020 Free Software Foundation, Inc. + Copyright (C) 2013-2021 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 --git a/libiberty/simple-object.c b/libiberty/simple-object.c index 92f5698..facbf94f 100644 --- a/libiberty/simple-object.c +++ b/libiberty/simple-object.c @@ -1,5 +1,5 @@ /* simple-object.c -- simple routines to read and write object files. - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. This program is free software; you can redistribute it and/or modify it @@ -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/snprintf.c b/libiberty/snprintf.c index 2ab931e..1e34598 100644 --- a/libiberty/snprintf.c +++ b/libiberty/snprintf.c @@ -1,5 +1,5 @@ /* Implement the snprintf function. - Copyright (C) 2003-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2021 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 --git a/libiberty/sort.c b/libiberty/sort.c index fd8f926..a6760eb 100644 --- a/libiberty/sort.c +++ b/libiberty/sort.c @@ -1,5 +1,5 @@ /* Sorting algorithms. - Copyright (C) 2000-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2021 Free Software Foundation, Inc. Contributed by Mark Mitchell <mark@codesourcery.com>. This file is part of GNU CC. diff --git a/libiberty/spaces.c b/libiberty/spaces.c index d97390b..5dcb5b1 100644 --- a/libiberty/spaces.c +++ b/libiberty/spaces.c @@ -1,5 +1,5 @@ /* Allocate memory region filled with spaces. - Copyright (C) 1991-2020 Free Software Foundation, Inc. + Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/splay-tree.c b/libiberty/splay-tree.c index 3b7b810..7c8973c 100644 --- a/libiberty/splay-tree.c +++ b/libiberty/splay-tree.c @@ -1,5 +1,5 @@ /* A splay-tree datatype. - Copyright (C) 1998-2020 Free Software Foundation, Inc. + Copyright (C) 1998-2021 Free Software Foundation, Inc. Contributed by Mark Mitchell (mark@markmitchell.com). This file is part of GNU CC. diff --git a/libiberty/stack-limit.c b/libiberty/stack-limit.c index 390adf3..fa9e38d 100644 --- a/libiberty/stack-limit.c +++ b/libiberty/stack-limit.c @@ -1,5 +1,5 @@ /* Increase stack size limit if possible. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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 --git a/libiberty/stpcpy.c b/libiberty/stpcpy.c index 2b0a850..5f2a48e 100644 --- a/libiberty/stpcpy.c +++ b/libiberty/stpcpy.c @@ -1,5 +1,5 @@ /* Implement the stpcpy function. - Copyright (C) 2003-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2021 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>. This file is part of the libiberty library. diff --git a/libiberty/stpncpy.c b/libiberty/stpncpy.c index 641b8f9..8c7306c 100644 --- a/libiberty/stpncpy.c +++ b/libiberty/stpncpy.c @@ -1,5 +1,5 @@ /* Implement the stpncpy function. - Copyright (C) 2003-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2021 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>. This file is part of the libiberty library. diff --git a/libiberty/strndup.c b/libiberty/strndup.c index a7ff3a9..1d300ed 100644 --- a/libiberty/strndup.c +++ b/libiberty/strndup.c @@ -1,5 +1,5 @@ /* Implement the strndup function. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>. This file is part of the libiberty library. diff --git a/libiberty/strtod.c b/libiberty/strtod.c index de8c54c..c23eac4 100644 --- a/libiberty/strtod.c +++ b/libiberty/strtod.c @@ -1,5 +1,5 @@ /* Implementation of strtod for systems with atof. - Copyright (C) 1991-2020 Free Software Foundation, Inc. + Copyright (C) 1991-2021 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 --git a/libiberty/strverscmp.c b/libiberty/strverscmp.c index c317346..57a71da 100644 --- a/libiberty/strverscmp.c +++ b/libiberty/strverscmp.c @@ -1,7 +1,7 @@ /* Compare strings while treating digits characters numerically. - Copyright (C) 1997-2020 Free Software Foundation, Inc. + Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the libiberty library. - Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997. + Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997. Libiberty is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/libiberty/testsuite/Makefile.in b/libiberty/testsuite/Makefile.in index 1f05557..5d0d1e6 100644 --- a/libiberty/testsuite/Makefile.in +++ b/libiberty/testsuite/Makefile.in @@ -1,6 +1,6 @@ # # Makefile -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is part of the libiberty library. # Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected index ba0ffed..c35185c 100644 --- a/libiberty/testsuite/d-demangle-expected +++ b/libiberty/testsuite/d-demangle-expected @@ -83,7 +83,11 @@ demangle.test(ulong) # --format=dlang _D8demangle4testFnZv -demangle.test(none) +demangle.test(typeof(null)) +# +--format=dlang +_D8demangle4testFNnZv +demangle.test(typeof(*null)) # --format=dlang _D8demangle4testFoZv @@ -1414,3 +1418,31 @@ std.algorithm.iteration.FilterResult!(std.typecons.Tuple!(int, "a", int, "b", in --format=dlang _D3std3uni__T6toCaseS_DQvQt12toLowerIndexFNaNbNiNewZtVii1043S_DQCjQCi10toLowerTabFNaNbNiNemZwSQDo5ascii7toLowerTAyaZQDzFNaNeQmZ14__foreachbody2MFNaNeKmKwZ14__foreachbody3MFNaNeKwZi std.uni.toCase!(std.uni.toLowerIndex(dchar), 1043, std.uni.toLowerTab(ulong), std.ascii.toLower, immutable(char)[]).toCase(immutable(char)[]).__foreachbody2(ref ulong, ref dchar).__foreachbody3(ref dchar) +# +--format=dlang +_D8demangle4mainFZ1xi +demangle.main().x +# +--format=dlang +_D8demangle4mainFZ4__S11xi +demangle.main().x +# +--format=dlang +_D8demangle4mainFZ1fMFNaNbNiNfZv +demangle.main().f() +# +--format=dlang +_D8demangle4mainFZ4__S11fMFNaNbNiNfZv +demangle.main().f() +# +--format=dlang +_D3mod4funcFZ__T6nestedTiZQkMFNaNbNiNfZi +mod.func().nested!(int).nested() +# +--format=dlang +_D3mod4funcFZ__T6nestedTiZ4__S1QpMFNaNbNiNfZi +mod.func().nested!(int).nested() +# +--format=dlang +_D6mangle__T8fun21753VSQv6S21753S1f_DQBj10__lambda71MFNaNbNiNfZvZQCbQp +mangle.fun21753!(mangle.S21753(mangle.__lambda71())).fun21753 diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index e6b5b64..19a0d62 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 diff --git a/libiberty/testsuite/demangler-fuzzer.c b/libiberty/testsuite/demangler-fuzzer.c index 9e35caa..aa73399 100644 --- a/libiberty/testsuite/demangler-fuzzer.c +++ b/libiberty/testsuite/demangler-fuzzer.c @@ -1,6 +1,6 @@ /* Demangler fuzzer. - Copyright (C) 2014-2020 Free Software Foundation, Inc. + Copyright (C) 2014-2021 Free Software Foundation, Inc. This file is part of GNU libiberty. diff --git a/libiberty/testsuite/test-demangle.c b/libiberty/testsuite/test-demangle.c index eb3bcbd..b8024f2 100644 --- a/libiberty/testsuite/test-demangle.c +++ b/libiberty/testsuite/test-demangle.c @@ -1,5 +1,5 @@ /* Demangler test program, - Copyright (C) 2002-2020 Free Software Foundation, Inc. + Copyright (C) 2002-2021 Free Software Foundation, Inc. Written by Zack Weinberg <zack@codesourcery.com This file is part of GNU libiberty. diff --git a/libiberty/testsuite/test-expandargv.c b/libiberty/testsuite/test-expandargv.c index 66bc010..56c170f 100644 --- a/libiberty/testsuite/test-expandargv.c +++ b/libiberty/testsuite/test-expandargv.c @@ -1,5 +1,5 @@ /* expandargv test program, - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 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 --git a/libiberty/testsuite/test-pexecute.c b/libiberty/testsuite/test-pexecute.c index 30c990d..c26296f 100644 --- a/libiberty/testsuite/test-pexecute.c +++ b/libiberty/testsuite/test-pexecute.c @@ -1,5 +1,5 @@ /* Pexecute test program, - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@airs.com>. This file is part of GNU libiberty. diff --git a/libiberty/testsuite/test-strtol.c b/libiberty/testsuite/test-strtol.c index fd5f89d..6c13206 100644 --- a/libiberty/testsuite/test-strtol.c +++ b/libiberty/testsuite/test-strtol.c @@ -1,5 +1,5 @@ /* Test program for strtol family of funtions, - Copyright (C) 2014-2020 Free Software Foundation, Inc. + Copyright (C) 2014-2021 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 --git a/libiberty/timeval-utils.c b/libiberty/timeval-utils.c index ee46b56..3094a78 100644 --- a/libiberty/timeval-utils.c +++ b/libiberty/timeval-utils.c @@ -1,5 +1,5 @@ /* Basic struct timeval utilities. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/unlink-if-ordinary.c b/libiberty/unlink-if-ordinary.c index b4d6f0a..04ed99f 100644 --- a/libiberty/unlink-if-ordinary.c +++ b/libiberty/unlink-if-ordinary.c @@ -1,5 +1,5 @@ /* unlink-if-ordinary.c - remove link to a file unless it is special - Copyright (C) 2004-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2021 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 --git a/libiberty/vasprintf.c b/libiberty/vasprintf.c index 0bdd41a..de6f073 100644 --- a/libiberty/vasprintf.c +++ b/libiberty/vasprintf.c @@ -1,6 +1,6 @@ /* Like vsprintf but provides a pointer to malloc'd storage, which must be freed by the caller. - Copyright (C) 1994-2020 Free Software Foundation, Inc. + Copyright (C) 1994-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/vfprintf.c b/libiberty/vfprintf.c index 433d12d..daa32fa 100644 --- a/libiberty/vfprintf.c +++ b/libiberty/vfprintf.c @@ -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-2020 Free Software Foundation, Inc. + Copyright (C) 1998-2021 Free Software Foundation, Inc. */ #include "ansidecl.h" diff --git a/libiberty/vprintf-support.c b/libiberty/vprintf-support.c index 52e7378..62f9ffc 100644 --- a/libiberty/vprintf-support.c +++ b/libiberty/vprintf-support.c @@ -1,6 +1,6 @@ /* Estimate the length of the string generated by a vprintf-like function. Used by vasprintf and xvasprintf. - Copyright (C) 1994-2020 Free Software Foundation, Inc. + Copyright (C) 1994-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/vprintf-support.h b/libiberty/vprintf-support.h index ea689df..29e1726 100644 --- a/libiberty/vprintf-support.h +++ b/libiberty/vprintf-support.h @@ -1,6 +1,6 @@ /* Estimate the length of the string generated by a vprintf-like function. Use by vasprintf and xvasprintf. - Copyright (C) 1994-2020 Free Software Foundation, Inc. + Copyright (C) 1994-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/vsnprintf.c b/libiberty/vsnprintf.c index 76a7711..6aa1c09 100644 --- a/libiberty/vsnprintf.c +++ b/libiberty/vsnprintf.c @@ -1,5 +1,5 @@ /* Implement the vsnprintf function. - Copyright (C) 2003-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2021 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 --git a/libiberty/vsprintf.c b/libiberty/vsprintf.c index 6337569..5517704 100644 --- a/libiberty/vsprintf.c +++ b/libiberty/vsprintf.c @@ -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-2020 Free Software Foundation, Inc. + Copyright (C) 1991-2021 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 --git a/libiberty/xasprintf.c b/libiberty/xasprintf.c index 76fb4b3..6975a1d 100644 --- a/libiberty/xasprintf.c +++ b/libiberty/xasprintf.c @@ -1,5 +1,5 @@ /* Implement the xasprintf function. - Copyright (C) 2014-2020 Free Software Foundation, Inc. + Copyright (C) 2014-2021 Free Software Foundation, Inc. Contributed by Manuel Lopez-Ibanez. This file is part of the libiberty library. diff --git a/libiberty/xexit.c b/libiberty/xexit.c index 268aef1..51efe79 100644 --- a/libiberty/xexit.c +++ b/libiberty/xexit.c @@ -1,5 +1,5 @@ /* xexit.c -- Run any exit handlers, then exit. - Copyright (C) 1994-2020 Free Software Foundation, Inc. + Copyright (C) 1994-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or diff --git a/libiberty/xmalloc.c b/libiberty/xmalloc.c index 96d51b5..b9e23c3 100644 --- a/libiberty/xmalloc.c +++ b/libiberty/xmalloc.c @@ -1,5 +1,5 @@ /* memory allocation routines with error checking. - Copyright (C) 1989-2020 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or @@ -87,7 +87,9 @@ extern "C" { void *malloc (size_t); void *realloc (void *, size_t); void *calloc (size_t, size_t); +#ifdef HAVE_SBRK void *sbrk (ptrdiff_t); +#endif # ifdef __cplusplus } # endif /* __cplusplus */ diff --git a/libiberty/xstrndup.c b/libiberty/xstrndup.c index 32ba832..1ad175d 100644 --- a/libiberty/xstrndup.c +++ b/libiberty/xstrndup.c @@ -1,5 +1,5 @@ /* Implement the xstrndup function. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>. This file is part of the libiberty library. diff --git a/libiberty/xvasprintf.c b/libiberty/xvasprintf.c index 1ac513e..7911901 100644 --- a/libiberty/xvasprintf.c +++ b/libiberty/xvasprintf.c @@ -1,5 +1,5 @@ /* Implement the xvasprintf function. - Copyright (C) 2014-2020 Free Software Foundation, Inc. + Copyright (C) 2014-2021 Free Software Foundation, Inc. Contributed by Manuel Lopez-Ibanez. This file is part of the libiberty library. |