1. 26 Jul, 2018 1 commit
    • Add linker_output as prefix for LTO temps (PR lto/86548). · c00c9d03
      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
      Martin Liska committed
  2. 19 Jul, 2018 1 commit
  3. 30 May, 2018 2 commits
  4. 28 May, 2018 1 commit
    • splay-tree.h (splay_tree_compare_strings, [...]): Declare new utility functions. · b0c31bc6
      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
      Bernd Edlinger committed
  5. 10 May, 2018 1 commit
  6. 30 Apr, 2018 1 commit
  7. 13 Apr, 2018 1 commit
  8. 02 Mar, 2018 1 commit
  9. 21 Jan, 2018 1 commit
  10. 11 Jan, 2018 1 commit
    • re PR lto/81968 (early lto debug objects make Solaris ld SEGV) · bf6f2cc7
      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
      Richard Biener committed
  11. 10 Jan, 2018 1 commit
  12. 03 Jan, 2018 1 commit
  13. 02 Jan, 2018 1 commit
    • re PR lto/83452 (FAIL: gfortran.dg/save_6.f90 -O0 (test for excess errors)) · c1177db4
      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
      Richard Biener committed
  14. 30 Oct, 2017 1 commit
  15. 24 Oct, 2017 1 commit
    • PR82687, g++.dg/asan/default-options-1.C fails with PR82575 fix · 160826fe
      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
      Alan Modra committed
  16. 19 Oct, 2017 1 commit
    • PR82575, lto debugobj references __gnu_lto_slim, ld test liblto-17 fails · ebd208bf
      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
      Alan Modra committed
  17. 18 Oct, 2017 1 commit
  18. 26 Sep, 2017 1 commit
  19. 21 Sep, 2017 1 commit
  20. 15 Sep, 2017 3 commits
  21. 12 Sep, 2017 1 commit
    • Add DW_CFA_AARCH64_negate_ra_state to dwarf2.def/h and dwarfnames.c · ff971abe
        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
      Jiong Wang committed
  22. 01 Sep, 2017 1 commit
  23. 31 Aug, 2017 1 commit
  24. 30 Aug, 2017 1 commit
  25. 28 Aug, 2017 1 commit
  26. 22 Aug, 2017 1 commit
  27. 21 Aug, 2017 1 commit
    • re PR go/78628 (GO fails to build a translation unit decl) · 1ea85365
      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
      Richard Biener committed
  28. 02 Jul, 2017 1 commit
    • include/ChangeLog · ef29f5dd
      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
      Jan Kratochvil committed
  29. 07 Jun, 2017 1 commit
    • simple-object-xcoff.c (simple_object_xcoff_find_sections): Search symbol table… · c1d24904
      simple-object-xcoff.c (simple_object_xcoff_find_sections): Search symbol 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
      Tony Reix committed
  30. 31 May, 2017 1 commit
  31. 27 May, 2017 3 commits
  32. 24 May, 2017 1 commit
  33. 01 May, 2017 3 commits
    • d-demangle.c (dlang_hexdigit): New function. · 5398cab9
      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
      Iain Buclaw committed
    • d-demangle.c (strtol): Remove declaration. · dbe65f77
      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
      Iain Buclaw committed
    • d-demangle.c (dlang_parse_symbol): Remove function. · 5a4dbf7d
      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
      Iain Buclaw committed