diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-27 14:36:48 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-27 14:36:48 +0000 |
commit | b33542ab8c3bcc4cfb595b335889eada3c2e34d4 (patch) | |
tree | 6a51259b773d6ffc2a40c93fe609a3331fd17b5f /gcc/toplev.c | |
parent | 77237956fe7207879d9ad4b64f91fa2392e9c652 (diff) | |
download | gcc-b33542ab8c3bcc4cfb595b335889eada3c2e34d4.tar.gz |
* doc/invoke.texi (ffat-lto-objects): Document.
* toplev.c (compile_file): Do not output assembly when doing slim lto;
Output __gnu_slim_lto when doing slim lto.
* cgraphunit.c (ipa_passes): Do only analysis when producing slim lto.
(cgraph_optimize): Return early when doing slim lto.
* opts.c (finish_options): Complain about lack of linker plugin
when doing slim lto.
* common.opt (ffat-lto-objects): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179271 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 70 |
1 files changed, 46 insertions, 24 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index de0a58a6773..3688c093a3f 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -569,40 +569,45 @@ compile_file (void) return; } - varpool_assemble_pending_decls (); - finish_aliases_2 (); + /* Compilation unit is finalized. When producing non-fat LTO object, we are + basically finished. */ + if (in_lto_p || !flag_lto || flag_fat_lto_objects) + { + varpool_assemble_pending_decls (); + finish_aliases_2 (); - /* Likewise for mudflap static object registrations. */ - if (flag_mudflap) - mudflap_finish_file (); + /* Likewise for mudflap static object registrations. */ + if (flag_mudflap) + mudflap_finish_file (); - output_shared_constant_pool (); - output_object_blocks (); + output_shared_constant_pool (); + output_object_blocks (); - /* Write out any pending weak symbol declarations. */ - weak_finish (); + /* Write out any pending weak symbol declarations. */ + weak_finish (); - /* This must be at the end before unwind and debug info. - Some target ports emit PIC setup thunks here. */ - targetm.asm_out.code_end (); + /* This must be at the end before unwind and debug info. + Some target ports emit PIC setup thunks here. */ + targetm.asm_out.code_end (); - /* Do dbx symbols. */ - timevar_push (TV_SYMOUT); + /* Do dbx symbols. */ + timevar_push (TV_SYMOUT); -#if defined DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO - if (dwarf2out_do_frame ()) - dwarf2out_frame_finish (); -#endif + #if defined DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO + if (dwarf2out_do_frame ()) + dwarf2out_frame_finish (); + #endif - (*debug_hooks->finish) (main_input_filename); - timevar_pop (TV_SYMOUT); + (*debug_hooks->finish) (main_input_filename); + timevar_pop (TV_SYMOUT); - /* Output some stuff at end of file if nec. */ + /* Output some stuff at end of file if nec. */ - dw2_output_indirect_constants (); + dw2_output_indirect_constants (); - /* Flush any pending external directives. */ - process_pending_assemble_externals (); + /* Flush any pending external directives. */ + process_pending_assemble_externals (); + } /* Emit LTO marker if LTO info has been previously emitted. This is used by collect2 to determine whether an object file contains IL. @@ -623,6 +628,23 @@ compile_file (void) (unsigned HOST_WIDE_INT) 1, (unsigned HOST_WIDE_INT) 1); #endif + /* Let linker plugin know that this is a slim object and must be LTOed + even when user did not ask for it. */ + if (!flag_fat_lto_objects) + { +#if defined ASM_OUTPUT_ALIGNED_DECL_COMMON + ASM_OUTPUT_ALIGNED_DECL_COMMON (asm_out_file, NULL_TREE, + "__gnu_slim_lto", + (unsigned HOST_WIDE_INT) 1, 8); +#elif defined ASM_OUTPUT_ALIGNED_COMMON + ASM_OUTPUT_ALIGNED_COMMON (asm_out_file, "__gnu_slim_lto", + (unsigned HOST_WIDE_INT) 1, 8); +#else + ASM_OUTPUT_COMMON (asm_out_file, "__gnu_slim_lto", + (unsigned HOST_WIDE_INT) 1, + (unsigned HOST_WIDE_INT) 1); +#endif + } } /* Attach a special .ident directive to the end of the file to identify |