aboutsummaryrefslogtreecommitdiff
path: root/libiberty
AgeCommit message (Collapse)AuthorFilesLines
2018-11-05Implement P0732R2, class types in non-type template parameters.Jason Merrill3-1/+30
There is one significant piece of this that is not implemented yet: the reliance on defaulted operator<=>, which someone else has been working on. So, for the moment those lines are commented out of the testcases. One tricky bit was treating template parameters of classtype as const lvalues without making their decltype const; for this I used a VIEW_CONVERT_EXPR wrapper, which previously could only appear in templates as location wrappers. The user-defined literal parts of P0732R2 are in the next patch. gcc/cp/ * error.c (dump_simple_decl): Look through a template parm object. * mangle.c (write_template_arg): Likewise. (mangle_template_parm_object): New. * pt.c (template_parm_object_p, get_template_parm_object): New. (invalid_tparm_referent_p): Factor from convert_nontype_argument. (convert_nontype_argument, invalid_nontype_parm_type_p): Handle class-type template arguments. * tree.c (lvalue_kind): Likewise. gcc/c-family/ * c-cppbuiltin.c (c_cpp_builtins): Add __cpp_nontype_template_parameter_class. libiberty/ * cp-demangle.c (d_dump, d_make_comp, d_count_templates_scopes) (d_print_comp_inner): Handle DEMANGLE_COMPONENT_TPARM_OBJ. (d_special_name): Handle TA. (d_expresion_1): Fix demangling of brace-enclosed initializer list. include/ * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_TPARM_OBJ. From-SVN: r265789
2018-10-31Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856).Joseph Myers4-511/+627
This patch updates GCC to use autoconf 2.69 and automake 1.15.1. (That's not the latest automake version, but it's the one used by binutils-gdb, with which consistency is desirable, and in any case seems a useful incremental update that should make a future update to 1.16.1 easier.) The changes are generally similar to the binutils-gdb ones, and are copied from there where shared files and directories are involved (there are some further changes to such shared directories, however, which I'd expect to apply to binutils-gdb once this patch is in GCC). Largely, obsolete AC_PREREQ calls are removed, while many AC_LANG_SOURCE calls are added to avoid warnings from aclocal and autoconf. Multilib support is no longer included in core automake, meaning that multilib.am needs copying from automake's contrib directory into the GCC source tree. Autoconf 2.69 has Go support, so local copies of that support are removed. I hope the D support will soon be submitted to upstream autoconf so the local copy of that can be removed in a future update. Changes to how automake generates runtest calls mean quotes are removed from RUNTEST definitions in five lib*/testsuite/Makefile.am files (libatomic, libgomp, libitm, libphobos, libvtv; some others have RUNTEST definitions without quotes, which are still OK); libgo and libphobos also get -Wno-override added to AM_INIT_AUTOMAKE so those overrides of RUNTEST do not generate automake warnings. Note that the regeneration did not include regeneration of fixincludes/config.h.in (attempting such regeneration resulted in all the USED_FOR_TARGET conditionals disappearing; and I don't see anything in the fixincludes/ directory that would result in such conditionals being generated, unlike in the gcc/ directory). Also note that libvtv/testsuite/other-tests/Makefile.in was not regenerated; that directory is not listed as a subdirectory for which Makefile.in gets regenerated by calling "automake" in libvtv/, so I'm not sure how it's meant to be regenerated. While I mostly fixed warnings should running aclocal / automake / autoconf, there were various such warnings from automake in the libgfortran, libgo, libgomp, liboffloadmic, libsanitizer, libphobos directories that I did not fix, preferring to leave those to the relevant subsystem maintainers. Specifically, most of those warnings were of the following form (example from libgfortran): Makefile.am:48: warning: source file 'caf/single.c' is in a subdirectory, Makefile.am:48: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. I think it's best for the relevant maintainers to add subdir-objects and do any other associated Makefile.am changes needed. In some cases the paths in the warnings involved ../; I don't know if that adds any extra complications to the use of subdir-objects. I've tested this with native, cross and Canadian cross builds. The risk of any OS-specific issues should I hope be rather lower than if a libtool upgrade were included (we *should* do such an upgrade at some point, but it's more complicated - it involves identifying all our local libtool changes to see if any aren't included in the upstream version we update to, and reverting an upstream libtool patch that's inappropriate for use in GCC); I think it would be better to get this update into GCC so that people can test in different configurations and we can fix any issues found, rather than to try to get more and more testing done before it goes in. top level: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * multilib.am: New file. From automake. Merge from binutils-gdb: 2018-06-19 Simon Marchi <simon.marchi@ericsson.com> * libtool.m4: Use AC_LANG_SOURCE. * configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE. * ar-lib: New file. * test-driver: New file. * configure: Re-generate. config: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * math.m4, tls.m4: Use AC_LANG_SOURCE. Merge from binutils-gdb: 2018-06-19 Simon Marchi <simon.marchi@ericsson.com> * override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69. fixincludes: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * aclocal.m4, configure: Regenerate. gcc: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. Use single line for second argument of AC_DEFINE_UNQUOTED. * doc/install.texi (Tools/packages necessary for modifying GCC): Update to autoconf 2.69 and automake 1.15.1. * aclocal.m4, config.in, configure: Regenerate. gnattools: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * configure: Regenerate. gotools: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * config/go.m4: Remove file. * Makefile.am (ACLOCAL_AMFLAGS): Do not use -I ./config. * configure.ac: Remove AC_PREREQ. Do not include config/go.m4. * Makefile.in, aclocal.m4, configure: Regenerate. intl: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 Merge from binutils-gdb: 2018-06-19 Simon Marchi <simon.marchi@ericsson.com> * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ. * configure: Re-generate. * config.h.in: Re-generate. * aclocal.m4: Re-generate. libada: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * configure: Regenerate. libatomic: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. * acinclude.m4: Use AC_LANG_SOURCE. * configure.ac: Remove AC_PREREQ. * testsuite/Makefile.am (RUNTEST): Remove quotes. * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Regenerate. libbacktrace: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate. libcc1: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, configure: Regenerate. libcpp: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. * aclocal.m4, config.in, configure: Regenerate. libdecnumber: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 Merge from binutils-gdb: 2018-06-19 Simon Marchi <simon.marchi@ericsson.com> * configure.ac: Remove AC_PREREQ. * configure: Re-generate. * aclocal.m4. libffi: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. (AUTOMAKE_OPTIONS): Add info-in-builddir. (CLEANFILES): Remove doc/libffi.info. * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, configure, fficonfig.h.in, include/Makefile.in, man/Makefile.in, testsuite/Makefile.in: Regenerate. libgcc: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. * configure: Regenerate. libgfortran: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate. libgo [logically part of this change but omitted from the commit]: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. * config/go.m4: Remove file. * config/libtool.m4: Use AC_LANG_SOURCE. * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. Use -Wno-override in AM_INIT_AUTOMAKE call. * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Regenerate. libgomp: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am (AUTOMAKE_OPTIONS): Add info-in-builddir. (CLEANFILES): Remove libgomp.info. * configure.ac: Remove AC_PREREQ. * testsuite/Makefile.am (RUNTEST): Remove quotes. * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Regenerate. libhsail-rt: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, configure: Regenerate. libiberty: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 Merge from binutils-gdb: 2018-06-19 Simon Marchi <simon.marchi@ericsson.com> * configure.ac: Remove AC_PREREQ. * configure: Re-generate. * config.in: Re-generate. libitm: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. (AUTOMAKE_OPTIONS): Add info-in-builddir. (CLEANFILES): Remove libitm.info. * configure.ac: Remove AC_PREREQ. * testsuite/Makefile.am (RUNTEST): Remove quotes. * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Regenerate. libobjc: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. * aclocal.m4, config.h.in, configure: Regenerate. liboffloadmic: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. * plugin/Makefile.am: Include multilib.am. * plugin/configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, configure, plugin/Makefile.in, plugin/aclocal.m4, plugin/configure: Regenerate. libphobos: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. Use -Wno-override in AM_INIT_AUTOMAKE call. * m4/autoconf.m4: Add extra argument to AC_LANG_DEFINE call. * m4/druntime/os.m4: Use AC_LANG_SOURCE. * testsuite/Makefile.am (RUNTEST): Remove quotes. * Makefile.in, aclocal.m4, configure, libdruntime/Makefile.in, src/Makefile.in, testsuite/Makefile.in: Regenerate. libquadmath: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. (AUTOMAKE_OPTIONS): Remove 1.8. Add info-in-builddir. (all-local): Define outside conditional code. (CLEANFILES): Remove libquadmath.info. * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate. libsanitizer: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. * Makefile.in, aclocal.m4, asan/Makefile.in, configure, interception/Makefile.in, libbacktrace/Makefile.in, lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in, ubsan/Makefile.in: Regenerate. libssp: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. (AUTOMAKE_OPTIONS): Remove 1.9.5. * configure.ac: Remove AC_PREREQ. Quote argument to AC_RUN_IFELSE. * Makefile.in, aclocal.m4, configure: Regenerate. libstdc++-v3: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. * Makefile.in, aclocal.m4, configure, doc/Makefile.in, include/Makefile.in, libsupc++/Makefile.in, po/Makefile.in, python/Makefile.in, src/Makefile.in, src/c++11/Makefile.in, src/c++17/Makefile.in, src/c++98/Makefile.in, src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate. libvtv: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. * configure.ac: Remove AC_PREREQ. * testsuite/Makefile.am (RUNTEST): Remove quotes. * Makefile.in, aclocal.m4, configure, testsuite/Makefile.in: Regenerate. lto-plugin: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate. zlib: 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * Makefile.am: Include multilib.am. Merge from binutils-gdb: 2018-06-19 Simon Marchi <simon.marchi@ericsson.com> * configure.ac: Modernize AC_INIT call, remove AC_PREREQ. * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate. From-SVN: r265695
2018-10-01[libiberty] Use pipe inside pex_runNathan Sidwell5-45/+109
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg00039.html * configure.ac (checkfuncs): Add pipe2. * config.in, configure: Rebuilt. * pex-unix.c (pex_unix_exec_child): Comminicate errors from child to parent with a pipe, when possible. From-SVN: r264769
2018-08-27Replace 8 spaces with a tabular in ChangeLog files.Martin Liska1-4/+4
From-SVN: r263886
2018-08-23[libiberty patch] Fix PGO bootstrapNathan Sidwell2-80/+90
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01386.html PR driver/87056 * pex-unix.c (pex_unix_exec_child): Duplicate bad_fn into local scopes to avoid potential clobber. Co-Authored-By: Martin Liska <mliska@suse.cz> From-SVN: r263807
2018-08-21[libiberty patch] PEX-unix forkingNathan Sidwell2-86/+77
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01170.html * pex-unix.c (pex_child_error): Delete. (pex_unix_exec_child): Commonize error paths to single message & exit. From-SVN: r263679
2018-07-30cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0.Tom Tromey2-1/+6
2018-07-30 Tom Tromey <tom@tromey.com> * cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0. From-SVN: r263069
2018-07-26Add linker_output as prefix for LTO temps (PR lto/86548).Martin Liska2-6/+26
2018-07-26 Martin Liska <mliska@suse.cz> PR lto/86548 * lto-wrapper.c: Add linker_output as prefix for ltrans_output_file. 2018-07-26 Martin Liska <mliska@suse.cz> PR lto/86548 * libiberty.h (make_temp_file_with_prefix): New function. 2018-07-26 Martin Liska <mliska@suse.cz> PR lto/86548 * make-temp-file.c (TEMP_FILE): Remove leading 'cc'. (make_temp_file): Call make_temp_file_with_prefix with first argument set to NULL. (make_temp_file_with_prefix): Support also prefix. From-SVN: r262999
2018-07-19simple-object-elf.c (ENOTSUP): If not defined by errno.h, redirect to ENOSYS.Eli Zaretskii2-0/+9
2018-07-19 Eli Zaretskii <eliz@gnu.org> * simple-object-elf.c (ENOTSUP): If not defined by errno.h, redirect to ENOSYS. From-SVN: r262872
2018-05-30simple-object.h (simple_object_copy_lto_debug_sections): Add rename parameter.Jan Hubicka1-2/+0
* simple-object.h (simple_object_copy_lto_debug_sections): Add rename parameter. From-SVN: r260970
2018-05-30simple-object.h (simple_object_copy_lto_debug_sections): Add rename parameter.Jan Hubicka2-11/+43
* simple-object.h (simple_object_copy_lto_debug_sections): Add rename parameter. * simple-object.c (handle_lto_debug_sections): Add rename parameter. (handle_lto_debug_sections_rename): New function. (handle_lto_debug_sections_norename): New function. (simple_object_copy_lto_debug_sections): Add rename parameter. From-SVN: r260956
2018-05-28splay-tree.h (splay_tree_compare_strings, [...]): Declare new utility functions.Bernd Edlinger2-0/+24
include: 2018-05-28 Bernd Edlinger <bernd.edlinger@hotmail.de> * splay-tree.h (splay_tree_compare_strings, splay_tree_delete_pointers): Declare new utility functions. libiberty: 2018-05-28 Bernd Edlinger <bernd.edlinger@hotmail.de> * splay-tree.c (splay_tree_compare_strings, splay_tree_delete_pointers): New utility functions. gcc: 2018-05-28 Bernd Edlinger <bernd.edlinger@hotmail.de> * tree-dump.c (dump_node): Use splay_tree_delete_pointers. c-family: 2018-05-28 Bernd Edlinger <bernd.edlinger@hotmail.de> * c-lex.c (get_fileinfo): Use splay_tree_compare_strings and splay_tree_delete_pointers. cp: 2018-05-28 Bernd Edlinger <bernd.edlinger@hotmail.de> * decl2.c (start_static_storage_duration_function): Use splay_tree_delete_pointers. From-SVN: r260850
2018-05-10Improve boostrap-ubsan config (PR bootstrap/64914).Martin Liska2-1/+6
2018-05-10 Martin Liska <mliska@suse.cz> PR bootstrap/64914 * bootstrap-ubsan.mk: Define UBSAN_BOOTSTRAP. 2018-05-10 Martin Liska <mliska@suse.cz> PR bootstrap/64914 * md5.c: Use strict alignment with UBSAN_BOOTSTRAP. From-SVN: r260112
2018-04-30argv.c (expandargv): Fix memory leak for expanded arguments.Daniel van Gerpen2-0/+6
* argv.c (expandargv): Fix memory leak for expanded arguments. From-SVN: r259775
2018-04-13Fix gcc.dg/debug/pr41893-1.c with Solaris ld (PR lto/81968)Rainer Orth2-0/+11
PR lto/81968 * simple-object.c (handle_lto_debug_sections): Keep .comment section. From-SVN: r259364
2018-03-02libiberty: fix URL for demangler ABIDavid Malcolm2-1/+5
libiberty/ChangeLog: * cp-demangle.c: Update URL for g++ V3 ABI. From-SVN: r258155
2018-01-21simple-object-xcoff.c (simple_object_xcoff_find_sections): Use ulong_type to ↵Eli Zaretskii2-5/+19
avoid warning about 32-bit shift. * simple-object-xcoff.c (simple_object_xcoff_find_sections): Use ulong_type to avoid warning about 32-bit shift. From-SVN: r256925
2018-01-11re PR lto/81968 (early lto debug objects make Solaris ld SEGV)Richard Biener4-160/+279
2018-01-11 Richard Biener <rguenther@suse.de> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> PR lto/81968 libiberty/ * simple-object-common.h (struct simple_object_functions): Change copy_lto_debug_sections callback signature. * simple-object-elf.c (SHN_HIRESERVE, SHT_SYMTAB_SHNDX, SHF_INFO_LINK): Add defines. (simple_object_elf_copy_lto_debug_sections): Instead of leaving not to be copied sections empty unnamed SHT_NULL remove them from the target section headers and adjust section reference everywhere. Handle SHN_XINDEX in the symbol table processing properly. * simple-object.c (handle_lto_debug_sections): Change interface to return a modified string and handle renaming of relocation sections. Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> From-SVN: r256528
2018-01-10argv.c (expandargv): Correct check for dynamically allocated argv.Daniel van Gerpen2-3/+8
2018-01-10 Daniel van Gerpen <daniel@vangerpen.de> * argv.c (expandargv): Correct check for dynamically allocated argv. From-SVN: r256460
2018-01-03Update copyright years.Jakub Jelinek93-93/+97
From-SVN: r256169
2018-01-02re PR lto/83452 (FAIL: gfortran.dg/save_6.f90 -O0 (test for excess errors))Richard Biener2-23/+44
2017-01-02 Richard Biener <rguenther@suse.de> PR lto/83452 * simple-object-elf.c (simple_object_elf_copy_lto_debug_section): Do not use UNDEF locals for removed symbols but instead just define them in the first prevailing section and with no name. Use the same gnu_lto_v1 name for all removed globals we promote to WEAK UNDEFs so hpux can use a stub to provide this symbol. Clear sh_info and sh_link in removed sections. From-SVN: r256069
2017-10-30re PR lto/82757 (r251560 causes: plugin needed to handle lto object)Richard Biener2-1/+12
2017-10-30 Richard Biener <rguenther@suse.de> PR lto/82757 * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): Strip two leading _s from the __gnu_lto_* symbols. From-SVN: r254219
2017-10-24PR82687, g++.dg/asan/default-options-1.C fails with PR82575 fixAlan Modra2-10/+26
The problem with making discarded symbols hidden is that the non-default visibility is sticky. When symbols other than the __gnu_lto ones are discarded that turns out to be a bad idea. PR lto/82687 PR lto/82575 * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): Only make __gnu_lto symbols hidden. Delete outdated comment. Silence ISO C warning. From-SVN: r254042
2017-10-20PR82575, lto debugobj references __gnu_lto_slim, ld test liblto-17 failsAlan Modra2-6/+21
If __gnu_lto_slim is global, undefined, default visibility in the early debug object, then it finds its way into .dynsym when creating shared libraries. __gnu_lto_slim in a symbol table (.dynsym or .symtab) signals nm and other binutils that the object is an LTO object needing a plugin, but that isn't the case for the ld liblti-17 tests. So, make __gnu_lto_slim hidden to prevent it becoming dynamic. Further, make it weak because some linkers may warn on finding an undefined global non-default visibility symbol. PR lto/82575 * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): Make discarded non-local symbols weak and hidden. From-SVN: r253914
2017-10-18re PR lto/82598 (lto debugobj lacks .note.GNU-stack)Jakub Jelinek3-1/+21
PR lto/82598 * simple-object.c (handle_lto_debug_sections): Copy over also .note.GNU-stack section with unchanged name. * simple-object-elf.c (SHF_EXECINSTR): Define. (simple_object_elf_copy_lto_debug_section): Drop SHF_EXECINSTR bit on .note.GNU-stack section. From-SVN: r253851
2017-09-26re PR demangler/82195 (Undemangleable lambda)Nathan Sidwell3-22/+56
PR demangler/82195 * cp-demangle.c (d_encoding): Strip return type when name is a LOCAL_NAME. (d_local_name): Strip return type of enclosing TYPED_NAME. * testsuite/demangle-expected: Add and adjust tests. From-SVN: r253186
2017-09-21[demangler PATCH]: Revert and update generic lambda demanglingNathan Sidwell3-77/+85
https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01482.html PR demangler/82195 * cp-demangle.c (d_name): Revert addition of 'toplevel' parm. (has_return_type): Recurse for DEMANGLE_COMPONENT_LOCAL_NAME. (d_encoding): Revert d_name change. Use is_fnqual_component_type to strip modifiers that do not belong. (d_special_name, d_class_enum_type): Revert d_name call change. (d_expresion_1): Commonize DEMANGLE_COMPONENT_UNARY building. (d_local_name): Revert parsing of a function type. (d_print_comp_inner): An inner LOCAL_NAME might contain a TEMPLATE. * testsuite/demangle-expected: Add & adjust tests From-SVN: r253075
2017-09-15[demangler] Fix nested generic lambdaNathan Sidwell3-17/+59
https://gcc.gnu.org/ml/gcc-patches/2017-09/msg00994.html PR demangler/82195 * cp-demangle.c (d_name): Add 'toplevel' parm. Pass to ... (d_local_name): ... here. Parse trailing function args on nested local_name. (d_encoding, d_special_name, d_class_enum_type): Adjust d_name calls. * testsuite/demangle-expected: Add tests. From-SVN: r252815
2017-09-15re PR lto/81968 (early lto debug objects make Solaris ld SEGV)Richard Biener2-54/+74
2017-09-15 Richard Biener <rguenther@suse.de> PR lto/81968 * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): Iterate marking dependent sections necessary. From-SVN: r252807
2017-09-15[Demangle PATCH] Some pre-fix cleanupsNathan Sidwell3-40/+45
https://gcc.gnu.org/ml/gcc-patches/2017-09/msg00983.html * cp-demangle.c (is_fnqual_component_type): Reimplement using FNQUAL_COMPONENT_CASE. (d_encoding): Hold bare_function_type in local var. (d_local_name): Build name in both cases and build result once. Collapse switch-if to single conditional. * testsuite/demangle-expected: Realign blank lines with tests. From-SVN: r252802
2017-09-12Add DW_CFA_AARCH64_negate_ra_state to dwarf2.def/h and dwarfnames.cJiong Wang2-0/+6
A new vendor CFA DW_CFA_AARCH64_negate_ra_state was introduced for ARMv8.3-A return address signing, it is multiplexing DW_CFA_GNU_window_save in CFA vendor extension space. This patch adds necessary code to make it available to external, the GDB patch (https://sourceware.org/ml/gdb-patches/2017-08/msg00215.html) is intended to use it. A new DW_CFA_DUP for it is added in dwarf2.def. The use of DW_CFA_DUP is to avoid duplicated case value issue when included in libiberty/dwarfnames. Native x86 builds OK to make sure no macro expanding errors. Committed on behalf of Jiong Wang. include/ * dwarf2.def (DW_CFA_AARCH64_negate_ra_state): New DW_CFA_DUP. * dwarf2.h (DW_CFA_DUP): New define. libiberty/ * dwarfnames.c (DW_CFA_DUP): New define. From-SVN: r252037
2017-09-01Fix warning for simple-object-elf.c.Martin Liska2-1/+5
2017-09-01 Martin Liska <mliska@suse.cz> * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): Remove duplicite declaration. From-SVN: r251584
2017-08-31re PR lto/81968 (early lto debug objects make Solaris ld SEGV)Richard Biener2-3/+11
2017-08-31 Richard Biener <rguenther@suse.de> PR lto/81968 * simple-object-elf.c (simple_object_elf_copy_lto_debug_section): Keep names of removed global symbols. From-SVN: r251560
2017-08-30simple-object-xcoff.c (simple_object_xcoff_find_sections): Improve ↵Tony Reix2-45/+93
.go_export csect handling. * simple-object-xcoff.c (simple_object_xcoff_find_sections): Improve .go_export csect handling. Don't make assumptions on containing section or number of auxiliary entries. From-SVN: r251533
2017-08-28re PR lto/81968 (early lto debug objects make Solaris ld SEGV)Richard Biener2-2/+9
2017-08-28 Richard Biener <rguenther@suse.de> PR lto/81968 * simple-object-elf.c (simple_object_elf_copy_lto_debug_section): Adjust field with for sh_type write, set SHF_EXCLUDE only for removed sections. From-SVN: r251384
2017-08-22re PR lto/81925 (early lto debug link failure on aarch64_be)Richard Biener2-6/+14
2017-08-22 Richard Biener <rguenther@suse.de> PR lto/81925 * simple-object-elf.c (simple_object_elf_write_shdr): Adjust type of sh_addralign and sh_entsize and properly write sh_entsize as Elf_Addr. (simple_object_elf_write_to_file): Read sh_entsize as Elf_Addr. From-SVN: r251276
2017-08-21re PR go/78628 (GO fails to build a translation unit decl)Richard Biener7-21/+592
2017-08-21 Richard Biener <rguenther@suse.de> include/ * simple-object.h (simple_object_copy_lto_debug_sections): New function. libiberty/ * simple-object-common.h (struct simple_object_functions): Add copy_lto_debug_sections hook. * simple-object.c: Include fcntl.h. (handle_lto_debug_sections): New helper function. (simple_object_copy_lto_debug_sections): New function copying early LTO debug sections to regular debug sections in a new file. (simple_object_start_write): Handle NULL segment_name. * simple-object-coff.c (simple_object_coff_functions): Adjust for not implemented copy_lto_debug_sections hook. * simple-object-mach-o.c (simple_object_mach_o_functions): Likewise. * simple-object-xcoff.c (simple_object_xcoff_functions): Likewise. * simple-object-elf.c (SHT_NULL, SHT_SYMTAB, SHT_RELA, SHT_REL, SHT_GROUP): Add various sectopn header types. (SHF_EXCLUDE): Add flag. (Elf32_External_Sym, Elf64_External_Sym): Add symbol struct. (ELF_ST_BIND, ELF_ST_TYPE, ELF_ST_INFO): Add accessors. (STT_OBJECT, STT_FUNC, STT_TLS, STT_GNU_IFUNC): Add Symbol types. (STV_DEFAULT): Add symbol visibility. (SHN_COMMON): Add special section index name. (struct simple_object_elf_write): New. (simple_object_elf_start_write): Adjust for new private data. (simple_object_elf_write_shdr): Pass in values for all fields we write. (simple_object_elf_write_to_file): Adjust. Copy from recorded section headers if requested. (simple_object_elf_release_write): Release private data. (simple_object_elf_copy_lto_debug_sections): Copy and rename sections as denoted by PFN and all their dependences, symbols and relocations to the empty destination file. (simple_object_elf_functions): Adjust for copy_lto_debug_sections hook. gcc/ * debug.h (struct gcc_debug_hooks): Add die_ref_for_decl and register_external_die hooks. (debug_false_tree_charstarstar_uhwistar): Declare. (debug_nothing_tree_charstar_uhwi): Likewise. * debug.c (do_nothing_debug_hooks): Adjust. (debug_false_tree_charstarstar_uhwistar): New do nothing. (debug_nothing_tree_charstar_uhwi): Likewise. * dbxout.c (dbx_debug_hooks): Adjust. (xcoff_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * dwarf2out.c (macinfo_label_base): New global. (dwarf2out_register_external_die): New function for the register_external_die hook. (dwarf2out_die_ref_for_decl): Likewise for die_ref_for_decl. (dwarf2_debug_hooks): Use them. (dwarf2_lineno_debug_hooks): Adjust. (struct die_struct): Add with_offset flag. (DEBUG_LTO_DWO_INFO_SECTION, DEBUG_LTO_INFO_SECTION, DEBUG_LTO_DWO_ABBREV_SECTION, DEBUG_LTO_ABBREV_SECTION, DEBUG_LTO_DWO_MACINFO_SECTION, DEBUG_LTO_MACINFO_SECTION, DEBUG_LTO_DWO_MACRO_SECTION, DEBUG_LTO_MACRO_SECTION, DEBUG_LTO_LINE_SECTION, DEBUG_LTO_DWO_STR_OFFSETS_SECTION, DEBUG_LTO_STR_DWO_SECTION, DEBUG_STR_LTO_SECTION): New macros defining section names for the early LTO debug variants. (reset_indirect_string): New helper. (add_AT_external_die_ref): Helper for dwarf2out_register_external_die. (print_dw_val): Add support for offsetted symbol references. (get_ultimate_context): Split out from is_cxx. (is_cxx): Use get_ultimate_context. (is_fortran): Add decl overload. (compute_comp_unit_symbol): Split out worker from compute_section_prefix. (compute_section_prefix): Call compute_comp_unit_symbol and set comdat_type_p here. (output_die): Skip DIE symbol output for the LTO added one. Handle DIE symbol references with offset. (output_comp_unit): Guard section name mangling properly. For LTO debug sections emit a symbol at the section beginning which we use to refer to its DIEs. (add_abstract_origin_attribute): For DIEs registered via dwarf2out_register_external_die directly refer to the early DIE rather than indirectly through the shadow one we created. Remove obsolete call to dwarf2out_abstract_function for non-function/block origins. (gen_array_type_die): When generating early LTO debug do not emit DW_AT_string_length. (gen_formal_parameter_die): Do not re-create DIEs for PARM_DECLs late when in LTO. As suggested place a gcc_unreachable for the DECL_ABSTRACT_P case. (gen_subprogram_die): Avoid another specification DIE for early built declarations/definitions for the late LTO case. (gen_variable_die): Add type references for late duplicated VLA dies when in late LTO. (gen_inlined_subroutine_die): Do not call dwarf2out_abstract_function, we have the abstract instance already. (process_scope_var): Adjust decl DIE contexts in LTO which first puts them in limbo. (gen_decl_die): Do not generate type DIEs late apart from types for VLAs or for decls we do not yet have a DIE. Do not call dwarf2out_abstract_function late. (dwarf2out_early_global_decl): Make sure to create DIEs for abstract instances of a decl first. (dwarf2out_late_global_decl): Adjust comment. (output_macinfo_op): With multiple macro sections use macinfo_label_base to distinguish labels. (output_macinfo): Likewise. Update macinfo_label_base. Pass in the line info label. (note_variable_value_in_expr): When generating LTO resolve all variable values here by generating DIEs as needed. (init_sections_and_labels): Add early LTO debug flag parameter and generate different sections and names if set. Add generation counter for the labels so we can have multiple of them. (reset_dies): Helper to allow DIEs to be output multiple times. (dwarf2out_finish): When outputting DIEs to the fat part of an LTO object first reset DIEs. (dwarf2out_early_finish): Output early DIEs when generating LTO. (modified_type_die): Check for decl_ultimate_origin being self before recursing. (gen_type_die_with_usage): Likewise. (gen_typedef_die): Allow decl_ultimate_origin being self. (set_decl_abstract_flags): Remove. (set_block_abstract_flags): Likewise. (dwarf2out_abstract_function): Treat the early generated DIEs as the abstract copy and only add DW_AT_inline and DW_AT_artificial here and call set_decl_origin_self. If the DIE has an abstract origin don't do anything. * tree.c (free_lang_data): Build a dummy TRANSLATION_UNIT_DECL if we have none yet (Go fails to build one, PR78628). (variably_modified_type_p): Prevent endless recursion for Ada cyclic pointer types. * lto-streamer-in.c: Include debug.h. (dref_queue): New global. (lto_read_tree_1): Stream in DIE references. (lto_input_tree): Register DIE references. (input_function): Stream DECL_DEBUG_ARGS. * lto-streamer-out.c: Include debug.h. (lto_write_tree_1): Output DIE references. (DFS::DFS_write_tree_body): Follow DECL_ABSTRACT_ORIGIN. Force a TRANSLATION_UNIT_DECL DECL_CONTEXT for file-scope decls. (output_function): Stream DECL_DEBUG_ARGS. * tree-streamer-in.c (lto_input_ts_decl_common_tree_pointers): Stream DECL_ABSTRACT_ORIGIN. * tree-streamer-out.c (write_ts_decl_common_tree_pointers): Likewise. (write_ts_decl_minimal_tree_pointers): Force a TRANSLATION_UNIT_DECL DECL_CONTEXT for file-scope decls. * lto-streamer.h (struct dref_entry): Declare. (dref_queue): Likewise. * cfgexpand.c (pass_expand::execute): Do not call the outlining_inline_function hook here. * lto-wrapper.c (debug_obj): New global. (tool_cleanup): Unlink it if required. (debug_objcopy): New function. (run_gcc): Handle early debug sections in the IL files by extracting them to separate files, partially linkin them and feeding the result back as result to the linker. * config/darwin.h (DEBUG_LTO_INFO_SECTION, DEBUG_LTO_ABBREV_SECTION, DEBUG_LTO_MACINFO_SECTION, DEBUG_LTO_LINE_SECTION, DEBUG_STR_LTO_SECTION, DEBUG_LTO_MACRO_SECTION): Put early debug sections into a separate segment. * config/darwin.c (darwin_asm_named_section): Handle __GNU_DWARF_LTO segments. (darwin_asm_dwarf_section): Likewise. (darwin_asm_output_dwarf_offset): Likewise. * config/i386/i386.c (make_resolver_func): Set DECL_IGNORED_P. lto/ * lto.c (unify_scc): Truncate DIE reference queue for dropped SCCs. (lto_read_decls): Process TRANSLATION_UNIT_DECLs. Remove TYPE_DECL debug processing, register DIE references from prevailing SCCs with the debug machinery. (lto_section_with_id): Handle LTO debug sections. libstdc++/ * testsuite/libstdc++-prettyprinters/prettyprinters.exp: Run all tests with -flto as well if supported. testsuite/ * c-c++-common/asan/global-overflow-1.c: Adjust diagnostic location regex to handle the LTO case. * c-c++-common/asan/heap-overflow-1.c: Likewise. * c-c++-common/asan/misalign-1.c: Likewise. * c-c++-common/asan/misalign-2.c: Likewise. * c-c++-common/asan/null-deref-1.c: Likewise. * c-c++-common/asan/stack-overflow-1.c: Likewise. * c-c++-common/asan/strncpy-overflow-1.c: Likewise. * c-c++-common/asan/use-after-free-1.c: Likewise. * c-c++-common/asan/alloca_big_alignment.c: Likewise. * c-c++-common/asan/alloca_detect_custom_size.c: Likewise. * c-c++-common/asan/alloca_overflow_partial.c: Likewise. * c-c++-common/asan/alloca_overflow_right.c: Likewise. * c-c++-common/asan/alloca_underflow_left.c: Likewise. * g++.dg/asan/large-func-test-1.C: Likewise. * gfortran.dg/save_6.f90: Add -flto -g variant of save_5.f90. From-SVN: r251220
2017-07-02include/ChangeLogJan Kratochvil2-0/+15
2017-07-02 Jan Kratochvil <jan.kratochvil@redhat.com> * dwarf2.def (DW_IDX_compile_unit, DW_IDX_type_unit, DW_IDX_die_offset) (DW_IDX_parent, DW_IDX_type_hash, DW_IDX_lo_user, DW_IDX_hi_user) (DW_IDX_GNU_internal, DW_IDX_GNU_external): New. * dwarf2.h (DW_IDX, DW_IDX_DUP, DW_FIRST_IDX, DW_END_IDX): New. (enum dwarf_name_index_attribute): Remove. (get_DW_IDX_name): New declaration. libiberty/ChangeLog 2017-07-02 Jan Kratochvil <jan.kratochvil@redhat.com> * dwarfnames.c (DW_FIRST_IDX, DW_END_IDX, DW_IDX, DW_IDX_DUP): New. From-SVN: r249883
2017-06-07simple-object-xcoff.c (simple_object_xcoff_find_sections): Search symbol ↵Tony Reix2-9/+128
table for .go_export symbol and apply pfn if found. 2017-06-07 Tony Reix <tony.reix@atos.net> Matthieu Sarter <matthieu.sarter.external@atos.net> David Edelsohn <dje.gcc@gmail.com> * simple-object-xcoff.c (simple_object_xcoff_find_sections): Search symbol table for .go_export symbol and apply pfn if found. Co-Authored-By: David Edelsohn <dje.gcc@gmail.com> Co-Authored-By: Matthieu Sarter <matthieu.sarter.external@atos.net> From-SVN: r248999
2017-05-31configure.ac (strnlen): Add to AC_CHECK_DECLS.DJ Delorie4-1/+33
* configure.ac (strnlen): Add to AC_CHECK_DECLS. * configure: Likewise. * config.in: Add HACE_DECL_STRNLEN. From-SVN: r248721
2017-05-27d-demangle.c (dlang_identifier): Prefix mangled init symbols with ↵Iain Buclaw3-2/+9
`initializer for'. libiberty/ChangeLog: * d-demangle.c (dlang_identifier): Prefix mangled init symbols with `initializer for'. * testsuite/demangle-expected: Update tests. From-SVN: r248539
2017-05-27d-demangle.c (dlang_call_convention_p): Move declaration before dlang_type.Iain Buclaw3-24/+44
libiberty/ChangeLog: * d-demangle.c (dlang_call_convention_p): Move declaration before dlang_type. (dlang_type): Handle function types. * testsuite/d-demangle-expected: Add tests. From-SVN: r248538
2017-05-27d-demangle.c (dlang_parse_real): Remove stack buffer, write the demangled ↵Iain Buclaw3-17/+18
hexadecimal directly to string. libiberty/ChangeLog: * d-demangle.c (dlang_parse_real): Remove stack buffer, write the demangled hexadecimal directly to string. * testsuite/d-demangle-expected: Add tests. From-SVN: r248537
2017-05-24waitpid.c (wait): Define as a macro that calls _cwait, so that this function ↵Eli Zaretskii2-0/+10
works on MinGW. 2017-05-24 Eli Zaretskii <eliz@gnu.org> * libiberty/waitpid.c (wait) [__MINGW32__]: Define as a macro that calls _cwait, so that this function works on MinGW. From-SVN: r248430
2017-05-01d-demangle.c (dlang_hexdigit): New function.Iain Buclaw3-54/+86
libiberty/ChangeLog: * d-demangle.c (dlang_hexdigit): New function. (ascii2hex): Remove function. (dlang_parse_string): Update to call dlang_hexdigit. * testsuite/d-demangle-expected: Add tests. From-SVN: r247455
2017-05-01d-demangle.c (strtol): Remove declaration.Iain Buclaw3-47/+185
libiberty/ChangeLog: * d-demangle.c (strtol): Remove declaration. Updated all callers to use dlang_number. (dlang_number): New function. (dlang_value): Moved check for ISDIGIT into dlang_parse_integer. * testsuite/d-demangle-expected: Add tests. From-SVN: r247453
2017-05-01d-demangle.c (dlang_parse_symbol): Remove function.Iain Buclaw3-98/+142
libiberty/ChangeLog: * d-demangle.c (dlang_parse_symbol): Remove function. (dlang_parse_qualified): New function. (dlang_parse_mangle): New function. (dlang_type): Update to call dlang_parse_qualified. (dlang_identifier): Update to call either dlang_parse_qualified or dlang_parse_mangle. (dlang_type_modifier_p): Remove function. (dlang_call_convention_p): Don't allow type modifiers in mangle. (dlang_template_args): Update to call dlang_identifier. (dlang_demangle): Update to call dlang_parse_mangle. * testsuite/d-demangle-expected: Add tests. From-SVN: r247450
2017-05-01d-demangle.c (dlang_value): Add comment explaining why cases for digits are ↵Iain Buclaw3-17/+27
required. libiberty/ChangeLog: * d-demangle.c (dlang_value): Add comment explaining why cases for digits are required. * testsuite/d-demangle-expected: Update integer value tests. From-SVN: r247436
2017-05-01d-demangle.c (dlang_parse_symbol): Skip over anonymous symbols.Iain Buclaw3-1/+18
libiberty/ChangeLog: * d-demangle.c (dlang_parse_symbol): Skip over anonymous symbols. * testsuite/d-demangle-expected: Add tests. From-SVN: r247434
2017-05-01d-demangle.c (dlang_identifier): Handle template constraint symbols.Iain Buclaw3-9/+18
libiberty/ChangeLog: * d-demangle.c (dlang_identifier): Handle template constraint symbols. (dlang_parse_template): Only advance if template symbol prefix is followed by a digit. * testsuite/d-demangle-expected: Add tests. From-SVN: r247433