aboutsummaryrefslogtreecommitdiff
path: root/lto-plugin/lto-plugin.c
AgeCommit message (Collapse)AuthorFilesLines
2012-05-29* lto-plugin.c: Fix typo.Joseph Myers1-1/+1
From-SVN: r187982
2012-02-22re PR lto/50616 (lto1.exe: internal compiler error: invalid resolution in ↵Kai Tietz1-2/+10
the resolution file) PR lto/50616 * lto-plugin.c (PRI_LL): New macro. (dump_symtab): Use PRI_LL instead of ll in print. (process_symtab): Use PRI_LL instead of ll in scan. From-SVN: r184462
2011-10-02re PR lto/47247 (Linker plugin specification makes it difficult to handle ↵Jan Hubicka1-2/+10
COMDATs) PR lto/47247 * lto-plugin.c (get_symbols_v2): New variable. (write_resolution): Use V2 API when available. (onload): Handle LDPT_GET_SYMBOLS_V2. * lto-symtab.c (lto_symtab_resolve_symbols): Do not resolve when resolution is already availbale from plugin. (lto_symtab_merge_decls_1): Handle LDPR_PREVAILING_DEF_IRONLY_EXP. * cgraph.c (ld_plugin_symbol_resolution): Add prevailing_def_ironly_exp. * lto-cgraph.c (LDPR_NUM_KNOWN): Update. * ipa.c (varpool_externally_visible_p): IRONLY variables are never externally visible. * varasm.c (resolution_to_local_definition_p): Add LDPR_PREVAILING_DEF_IRONLY_EXP. (resolution_local_p): Likewise. * common.c (lto_resolution_str): Add new resolution. * common.h (lto_resolution_str): Likewise. From-SVN: r179424
2011-09-30Use 64bit integer for LTO symbol ID.H.J. Lu1-6/+8
gcc/lto 2011-09-30 H.J. Lu <hongjiu.lu@intel.com> Andi Kleen <ak@linux.intel.com> PR lto/50568 * lto.c (lto_splay_tree_delete_id): New. (lto_splay_tree_compare_ids): Likewise. (lto_splay_tree_lookup): Likewise. (lto_splay_tree_id_equal_p): Likewise. (lto_splay_tree_insert): Likewise. (lto_splay_tree_new): Likewise. (lto_resolution_read): Change id to unsigned HOST_WIDE_INT. Use lto_splay_tree_id_equal_p and lto_splay_tree_lookup. (create_subid_section_table): Use lto_splay_tree_lookup and lto_splay_tree_insert. (lto_file_read): Use lto_splay_tree_new. lto-plugin/ 2011-09-30 H.J. Lu <hongjiu.lu@intel.com> Andi Kleen <ak@linux.intel.com> PR lto/50568 * lto-plugin.c (sym_aux): Change id to unsigned long long. (plugin_symtab): Likewise. (dump_symtab): Likewise. (resolve_conflicts): Likewise. (process_symtab): Likewise. Co-Authored-By: Andi Kleen <ak@linux.intel.com> From-SVN: r179395
2011-04-20remove useless if-before-free testsJim Meyering1-4/+2
Change "if (E) free (E);" to "free (E);" everywhere except in the libgo/, intl/, zlib/ and classpath/ directories. Also transform equivalent variants like "if (E != NULL) free (E);" and allow an extra cast on the argument to free. Otherwise, the tested and freed "E" expressions must be identical, modulo white space. From-SVN: r172785
2011-04-05re PR lto/48431 (patch to fix a compile error in lto-plugin.c when using ↵Richard Guenther1-3/+3
older C compilers) 2011-04-05 Richard Guenther <rguenther@suse.de> PR bootstrap/48431 * lto-plugin.c (claim_file_handler): Do not declare vars in code. From-SVN: r171982
2011-01-25lto-plugin.c (gold_version): New static variable.Ian Lance Taylor1-1/+9
* lto-plugin.c (gold_version): New static variable. (all_symbols_read_handler): Don't check pass_through_items if using gold 1.11 or later. (onload): Set gold_version if we see LDPT_GOLD_VERSION. From-SVN: r169237
2011-01-12re PR lto/47264 (Many tests fail with -flto due unaligned load in lto-plugin.c)Richard Guenther1-2/+2
2011-01-12 Richard Guenther <rguenther@suse.de> PR lto/47264 * lto-plugin.c (parse_table_entry): Use memcpy to access unaligned fields. From-SVN: r168708
2010-12-10re PR middle-end/46674 (Weak alias is mistakenly optimized away)Dave Korn1-2/+2
gcc/ChangeLog: PR middle-end/46674 PR lto/43157 * target.def (mangle_assembler_name): New target asm_out hook. * targhooks.c (default_mangle_assembler_name): Add default hook implementation. * targhooks.h (default_mangle_assembler_name): Add prototype. * lto-symtab.c (lto_symtab_register_decl): Use new hook when processing DECL_ASSEMBLER_NAMEs for lto symtabs. (lto_symtab_get_resolution): Likewise. (lto_cgraph_replace_node): Likewise. (lto_symtab_prevailing_decl): Likewise. * lto-streamer-out.c (write_symbol): Likewise. * doc/tm.texi.in (TARGET_MANGLE_ASSEMBLER_NAME): Add @hook directive. * doc/tm.texi: Regenerate. * config/i386/cygming.h (TARGET_MANGLE_ASSEMBLER_NAME): Define to point at i386_pe_mangle_assembler_name. * config/i386/winnt.c (i386_pe_mangle_assembler_name): New function. * config/i386/i386-protos.h (i386_pe_mangle_assembler_name): Add prototype. lto-plugin/ChangeLog: PR middle-end/46674 PR lto/43157 * configure.ac (SYM_STYLE): Don't AC_DEFINE. * lto-plugin.c (sym_style): Don't use it; default to ss_none. * configure: Regenerate. * config.h.in: Likewise. gcc/testsuite/ChangeLog: PR middle-end/46674 PR lto/43157 * gcc.dg/pr43157.c: New file. From-SVN: r167688
2010-12-05config.h.in: Regenerated.Kai Tietz1-0/+6
2010-12-05 Kai Tietz <kai.tietz@onevision.com> * config.h.in: Regenerated. * configure: Regenerated. * configure.ac (AC_CHECK_HEADERS): Replaced by AC_HEADER_SYS_WAIT. * lto-plugin.c (WIFEXITED): Define default. (WEXITSTATUS): Likeiwse. From-SVN: r167468
2010-12-01config.h.in: Regenerated.Kai Tietz1-0/+2
2010-12-01 Kai Tietz <kai.tietz@onevision.com> * config.h.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. * configure.ac (AC_CHECK_HEADERS): Check for sys/wait.h. * lto-plugin.c: Include sys/wait.h conditionally. * aclocal.m4: Regenerated. From-SVN: r167343
2010-11-13lto-plugin.c (add_output_files): Fix memory leak.Kai Tietz1-1/+4
2010-11-13 Kai Tietz <kai.tietz@onevision.com> * lto-plugin.c (add_output_files): Fix memory leak. From-SVN: r166718
2010-11-11re PR bootstrap/46397 (lto-plugin.c does not build on Solaris 10/SPARC)Dave Korn1-8/+20
PR bootstrap/46397 PR bootstrap/46362 * configure.ac: Add AC_TYPE_INT64_T test. * config.h.in: Regenerate. * configure: Likewise. * lto-plugin.c (debug): Use char not bool. (nop): Likewise. (check_1): Rename from check, and use int not bool for gate argument. (check): Macro wrapper for the above to coerce gate argument into boolean-valued integer in case it has pointer type. (parse_table_entry): Use 0 not false. (claim_file_handler): Avoid use of PRIx64 by splitting 64-bit size into two 32-bit parts and printing as hex ints. From-SVN: r166601
2010-11-03re PR lto/46291 (Failed to bootstrap-lto)Dave Korn1-2/+0
PR lto/46291 * lto-plugin.c (claim_file_handler): Don't close file descriptor. From-SVN: r166285
2010-11-03re PR lto/46273 (Failed to bootstrap)Dave Korn1-17/+231
ChangeLog: 2010-11-03 Ian Lance Taylor <iant@google.com> Dave Korn <dave.korn.cygwin@gmail.com> PR lto/46273 * configure.ac: Remove libelf tests. Build lto-plugin on ELF always and on other supported platforms whenever LTO is enabled. * configure: Rebuild. gcc/ChangeLog: 2010-11-03 Ian Lance Taylor <iant@google.com> PR lto/46273 * gcc/config.gcc: Don't set lto_binary_reader. * doc/install.texi (Prerequisites): Remove libelf paragraphs. (Configuration): Mention --disable-lto. Remove --with-libelf paragraph. lto-plugin/ChangeLog: 2010-11-03 Dave Korn <dave.korn.cygwin@gmail.com> PR lto/46273 * lto-plugin.h: Delete. * lto-plugin-elf.c: Likewise. * lto-plugin-coff.c: Likewise. * configure.ac: Don't use libelf, don't source config.gcc. (LIBELFLIBS): Delete. (LIBELFINC): Delete. (LTO_FORMAT): Delete. (SYM_STYLE): Add AC_DEFINE var, set based on $target. (config.h): Add AC_CONFIG_HEADERS directive. * Makefile.am (LIBELFLIBS): Delete. (LIBELFINC): Delete. (LTO_FORMAT): Delete. (DEFS): Import. (AM_CPPFLAGS): Use it. Don't use LIBELFINC. (liblto_plugin_la_SOURCES): Don't use LTO_FORMAT, don't include any object-format-specific source file in the link. (liblto_plugin_la_LIBADD): Don't use LIBELFLIBS. * config.h.in: Generate. * configure: Regenerate. * Makefile.in: Likewise. * lto-plugin.c (O_BINARY): Definition moved here from lto-plugin.h. (LTO_SEGMENT_NAME): New definition. (LTO_SECTION_PREFIX): Definition moved here from lto-plugin.h. (LTO_SECTION_PREFIX_LEN): New definition. (struct sym_aux): Struct definition moved here from lto-plugin.h. (struct plugin_symtab): Likewise. (struct plugin_objfile): Likewise. (struct plugin_objfile): New struct def. (enum symbol_style): New enum type. (add_symbols): Make static. (claimed_files): Likewise. (num_claimed_files): Likewise. (sym_style): New global. (check): Make static. (parse_table_entry): Likewise. Respect sym_style when extracting symbol from symtab entry. (translate): Make static. (resolve_conflicts): Likewise. (process_symtab): New function, per-section callback version of old object-format-specific handling from deleted lto-plugin-elf.c. (claim_file_handler): Convert ELF-specific version from deleted lto-plugin-elf.c to simple_object interface and move here. (process_options): Allow new '-sym-style=' option. (onload): Don't call deleted onload_format_checks hook. From-SVN: r166233
2010-10-11lto-plugin.c (dump_symtab): Correct printf argument type.Kai Tietz1-2/+2
2010-10-11 Kai Tietz <kai.tietz@onevision.com> * lto-plugin.c (dump_symtab): Correct printf argument type. (finish_conflict_resolution): Initialize resolution. From-SVN: r165310
2010-10-07configure.ac (build_lto_plugin): New shell variable.Dave Korn1-165/+20
ChangeLog: 2010-10-07 Dave Korn <dave.korn.cygwin@gmail.com> * configure.ac (build_lto_plugin): New shell variable. (--enable-lto): Turn on by default for all non-ELF platforms that have had LTO support added so far. Set build_lto_plugin appropriately for both ELF and non-ELF. (configdirs): Add lto-plugin or not based on build_lto_plugin. * configure: Regenerate. gcc/ChangeLog: 2010-10-07 Dave Korn <dave.korn.cygwin@gmail.com> * config.host (host_lto_plugin_soname): New shell variable. * configure.ac (LTOPLUGINSONAME): Add an AC_DEFINE for the above. * config.in: Regenerate. * configure: Regenerate. * gcc.c (main): Use LTOPLUGINSONAME instead of hard-coding name of LTO plugin shared library. lto-plugin/ChangeLog: 2010-10-07 Dave Korn <dave.korn.cygwin@gmail.com> * configure.ac: Source config.gcc to determine lto_binary_reader. (LTO_FORMAT): New AC_SUBST variable inferred from lto_binary_reader. * Makefile.am (LTO_FORMAT): Import. (liblto_plugin_la_SOURCES): Add object format dependent module defined by LTO_FORMAT. (liblto_plugin_la_LIBADD): Allow for both PIC and non-PIC libiberty, and work around libtool warning. * configure: Regenerate. * Makefile.in: Likewise. * lto-plugin.c (struct sym_aux): Move to new lto-plugin.h. (struct sym_aux): Likewise. (struct plugin_symtab): Likewise. (struct plugin_file_info): Likewise. (LTO_SECTION_PREFIX): Likewise. (add_symbols): Make non-static. (claimed_files): Likewise. (num_claimed_files): Likewise. (check): Likewise. (parse_table_entry): Likewise. (translate): Likewise. (resolve_conflicts): Likewise. (process_symtab): Move to new lto-plugin-elf.c object format dependent source file. (claim_file_handler): Likewise, and make non-static. (onload): Call new onload_format_checks function. * lto-plugin.h: New file. (LTO_SECTION_PREFIX): Move here. (struct sym_aux): Likewise. (struct plugin_symtab): Likewise. (struct plugin_file_info): Likewise. (claim_file_handler): Add new function prototype. (onload_format_checks): Likewise. (check): Declare extern. (translate): Likewise. (parse_table_entry): Likewise. (resolve_conflicts): Likewise. (add_symbols): Likewise. (claimed_files): Likewise. (num_claimed_files): Likewise. * lto-plugin-elf.c (process_symtab): Move here. (claim_file_handler): Likewise, and make non-static. (onload_format_checks): New function factored out from onload. * lto-plugin-coff.c (claim_file_handler): New function stub. (onload_format_checks): Likewise. From-SVN: r165133
2010-08-05lto-plugin.c: Include <hashtab.h>Andi Kleen1-9/+221
* lto-plugin.c: Include <hashtab.h> (sym_aux): Add next_conflict field to save conflict chains. (plugin_file_info): Add conflicts symtab. (parse_table_entry): Initialize aux->next_conflict. (process_symtab): Increment found. (dump_symtab): Add. (finish_conflict_resolution): Add. (free_symtab): Add. (write_resolution): Remove symbols loop and move into dump_symtab. Call dump_symtab for main symbol and conflicts table. Call free_symtab to free conflicts table. (SWAP): Add. (eq_sym): Add. (hash_sym): Add. (symbol_strength): Add. (resolve_conflicts): Add. (claim_file_handler): Add n variable. Check return value of process_symtab. Call resolve_conflicts. From-SVN: r162915
2010-07-28lto-plugin.c (translate): Remove debug fprintf.Andi Kleen1-2/+0
* lto-plugin.c (translate): Remove debug fprintf. From-SVN: r162630
2010-07-23Cast to unsigned long.H.J. Lu1-1/+2
2010-07-23 H.J. Lu <hongjiu.lu@intel.com> PR bootstrap/45042 * lto-plugin.c (translate): Cast to unsigned long. From-SVN: r162465
2010-07-23re PR lto/44992 (ld -r breaks LTO)Andi Kleen1-62/+66
gcc: 2010-07-10 Andi Kleen <ak@linux.intel.com> PR lto/44992 * lto-opts.c (lto_write_options): Add NULL file_data argument to lto_get_section_name. * lto-section-out.c (lto_destroy_simple_output_block): Likewise. * lto-streamer-out.c (produce_asm): Likewise. (copy_function): Likewise. (produce_symtab): Likewise. (produce_asm_for_decls): Likewise. * lto-streamer.c (lto_get_section_name): Add file_data argument. Rewrite to add random postfix to LTO sections. * lto-streamer.h (lto_file_decl_data): Add next, id, resolutions. (lto_get_section_name): Add file_data argument to prototype. lto: 2010-07-10 Andi Kleen <ak@linux.intel.com> PR lto/44992 * lto.c: Include splay-tree.h (lto_resolution_read): Change to walk file_ids tree and parse extra file_id in resolution file. (lto_section_with_id): Add. (create_subid_section_table): Add. (lwstate): Add. (lto_create_files_from_ids): Add. (lto_file_read): Change to handle sub file ids and create list of file_datas. Add output argument for count. (get_section_data): Pass file_data to lto_get_section_name. (lto_flatten_file): Add. (read_cgraph_and_symbols): Handle linked lists of file_datas. lto-plugin: 2010-07-10 Andi Kleen <ak@linux.intel.com> PR lto/44992 * lto-plugin.c (sym_aux): Add. (plugin_symtab): Remove slots. Add aux and id. (parse_table_entry): Change to use aux instead of slots. (LTO_SECTION_PREFIX): Add. (translate): Improve buffer allocation. Change to append symbols to existing out buffer. (get_section): Remove. (process_symtab): Add. (free_2): Free symtab->aux. (write_resolution): Handle aux instead of slots. Print sub id to resolution file. (claim_file_handler): Clear lto_file. Replace get_symtab/translate calls with call to process_symtab. From-SVN: r162443
2010-05-21lto-plugin.c (write_resolution): Do not assert syms is non-NULL.Richard Guenther1-1/+0
2010-05-21 Richard Guenther <rguenther@suse.de> * lto-plugin.c (write_resolution): Do not assert syms is non-NULL. From-SVN: r159676
2010-05-07re PR lto/43857 (-fresolution causes an ICE)Richard Guenther1-19/+6
2010-05-07 Richard Guenther <rguenther@suse.de> * gcc.c (LINK_COMMAND_SPEC): Provide a resolution file to the linker plugin. (store_arg): Queue temp_filename for deletion instead of the whole argument. lto/ PR lto/43857 PR lto/43371 * lang.opt (fresolution): Change to ... (fresolution=): ... this. * lto-lang.c (lto_handle_option): Adjust. lto-plugin/ * lto-plugin.c (free_2): Do not free resolution_file. (write_resolution): Check that we were passed a resolution file. (all_symbols_read_handler): Adjust. (cleanup_handler): Do not remove the resolution file. (process_option): Handle -fresolution=. From-SVN: r159159
2010-04-23re PR lto/41550 (Fix security and portability issues in lto-plugin)Richard Guenther1-21/+28
2010-04-23 Richard Guenther <rguenther@suse.de> PR lto/41550 * lto-plugin.c (parse_table_entry): Use xstrdup and xrealloc. (translate): Likewise. (all_symbols_read_handler): Likewise. (claim_file_handler): Likewise. (process_option): Likewise. (add_output_files): Likewise. Remove filename length limit. From-SVN: r158673
2010-03-16Delete temporary output files.Dmitry Gorbachev1-0/+7
2010-03-16 Dmitry Gorbachev <d.g.gorbachev@gmail.com> PR lto/43336 * lto-plugin.c (cleanup_handler): Delete temporary output files. From-SVN: r157483
2010-01-03Pass -m* and -v to -plugin-optH.J. Lu1-2/+13
gcc/ 2010-01-03 H.J. Lu <hongjiu.lu@intel.com> PR lto/42520 * gcc.c (LINK_COMMAND_SPEC): Pass -m* and -v to -plugin-opt. lto-plugin/ 2010-01-03 H.J. Lu <hongjiu.lu@intel.com> PR lto/42520 * lto-plugin.c (exec_lto_wrapper): Output lto-wrapper command if -v is passed. From-SVN: r155601
2009-11-19re PR bootstrap/42096 (lto.c:289:7: error: implicit declaration of function ↵Rafael Avila de Espindola1-1/+1
'strtoll') 2009-11-19 Rafael Avila de Espindola <espindola@google.com> PR bootstrap/42096 * lto-plugin.c (claim_file_handler): Print offsets in hex. 2009-11-19 Rafael Avila de Espindola <espindola@google.com> PR bootstrap/42096 * lto-elf.c (lto_elf_file_open): Use lto_parse_hex. * lto.c (lto_parse_hex): New. (lto_resolution_read): Use lto_parse_hex. * lto.h (lto_parse_hex): New. From-SVN: r154330
2009-11-12lto-plugin.c (write_resolution): Assume resolution_file is set.Rafael Avila de Espindola1-9/+13
2009-11-12 Rafael Avila de Espindola <espindola@google.com> * lto-plugin.c (write_resolution): Assume resolution_file is set. Print the symbol name. (all_symbols_read_handler): Create a resolution file. Pass it to gcc. (cleanup_handler): Remove the resolution file. (process_option): Drop the -resolution option. 2009-11-12 Rafael Avila de Espindola <espindola@google.com> * lang.opt (fresolution): Renamed from resolution. * lto-lang.c (lto_handle_option): Handle new option name. * lto.c (lto_resolution_read): Add more checks. Discard rest of line. From-SVN: r154118
2009-11-05lto-plugin.c (temp_obj_dir_name): Remove.Rafael Avila de Espindola1-26/+13
2009-11-05 Rafael Avila de Espindola <espindola@google.com> * lto-plugin.c (temp_obj_dir_name): Remove. (arguments_file_name): New. (free_2): Free arguments_file_name instead of temp_obj_dir_name. (exec_lto_wrapper): Create arguments file with make_temp_file. (cleanup_handler): Don't remove the temporary directory. Remove the arguments file. (onload): Don't create the temporary directory. From-SVN: r153938
2009-11-04gcc.c (process_command): Handle arguments name@offset.Richard Guenther1-53/+22
2009-11-04 Richard Guenther <rguenther@suse.de> Rafael Avila de Espindola <espindola@google.com> * gcc.c (process_command): Handle arguments name@offset. 2009-11-04 Richard Guenther <rguenther@suse.de> Rafael Avila de Espindola <espindola@google.com> * lto-elf.c (lto_elf_build_section_table): Add the base offset. (lto_elf_file_open): Handle offsets in arguments name@offest. 2009-11-04 Richard Guenther <rguenther@suse.de> Rafael Avila de Espindola <espindola@google.com> * lto-plugin.c (plugin_file_info): Remove temp field. (cleanup_handler): Don't delete temporary objects. (claim_file_handler): Don't create temporary objects. Co-Authored-By: Rafael Avila de Espindola <espindola@google.com> From-SVN: r153903
2009-11-04lto-plugin.c (cleanup_handler): Don't cleanup if debugging.Rafael Avila de Espindola1-0/+3
2009-11-04 Rafael Avila de Espindola <espindola@google.com> * lto-plugin.c (cleanup_handler): Don't cleanup if debugging. From-SVN: r153899
2009-10-30re PR lto/41871 (lto-plugin gives: could not open/create temporary file)Rafael Avila de Espindola1-0/+3
2009-10-30 Rafael Avila de Espindola <espindola@google.com> PR41871 * lto-plugin.c (claim_file_handler): Close files that we created. From-SVN: r153764
2009-10-28lto-plugin.c (all_symbols_read_handler): Use LDPL_FATAL instead of LDPL_ERRORRafael Avila de Espindola1-6/+4
2009-10-28 Rafael Avila de Espindola <espindola@google.com> * lto-plugin.c (all_symbols_read_handler): Use LDPL_FATAL instead of LDPL_ERROR From-SVN: r153687
2009-10-16lto-plugin.c (message): New variable.Rafael Avila de Espindola1-33/+74
2009-10-16 Rafael Avila de Espindola <espindola@google.com> * lto-plugin.c (message): New variable. (check): New function. (parse_table_entry, translate, write_resolution,add_output_files, exec_lto_wrapper,claim_file_handler, onload): Use check instead of assert. (cleanup_handler): Use check instead of assert. Remove the arguments file if it exists. From-SVN: r152906
2009-10-15lto-plugin.c (resolution_file): New.Rafael Avila de Espindola1-10/+20
2009-10-15 Rafael Avila de Espindola <espindola@google.com> * lto-plugin.c (resolution_file): New. (free_1): Update comment. (free_2): Free resolution_file. (write_resolution): Write resolution to specified file. Use the syms array from the symbol table. (all_symbols_read_handler): Delay call to free_1 past call to write_resolution. (process_option): Add a -resolution option. From-SVN: r152846
2009-10-08lto-plugin.c (add_input_library): New.Rafael Avila de Espindola1-3/+12
2009-10-08 Rafael Avila de Espindola <espindola@google.com> * lto-plugin.c (add_input_library): New. (all_symbols_read_handler): Use add_input_library for items that start with -l. (process_option): Fit in 80 columns. (onload): Handle LDPT_ADD_INPUT_LIBRARY. 2009-10-08 Rafael Avila de Espindola <espindola@google.com> * gcc.c (LINK_COMMAND_SPEC): Pass libc with -pass-through if it is being statically linked. From-SVN: r152558
2009-10-03Merge lto branch into trunk.Diego Novillo1-0/+689
From-SVN: r152434