This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [LTO][PATCH] Fix undefined symbol problem with static functions.
- From: Diego Novillo <dnovillo at google dot com>
- To: Doug Kwan (éæå) <dougkwan at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 2 Dec 2008 22:55:13 -0500
- Subject: Re: [LTO][PATCH] Fix undefined symbol problem with static functions.
- References: <498552560812021835s31fe6830nb3ea7763e86c27b6@mail.gmail.com>
On Tue, Dec 2, 2008 at 21:35, Doug Kwan (éæå) <dougkwan@google.com> wrote:
> 2008-12-02 Doug Kwan <dougkwan@google.com>
>
> ChangeLog.lto:
> * lto-function-out.c (output_remaining_constructors_and_inits):
> Use lto_get_decl_flags and LTO_DECL_FLAG_DEFINED instead of
> lto_get_var_flags and LTO_VAR_FLAG_DEFINED respectively.
> (output_function_decl): Add code to write out LTO DECL flags.
> (output_var_decl): Use lto_get_decl_flags instead of
> lto_get_var_flags. Use LTO_DECL_FLAG_* instead of LTO_VAR_FLAG_*.
> * lto-function-in.c (input_function_decl): Add code to read LTO
> DECL flags and force a static DECL to be global if necessary.
> (input_var_decl): Use lto_get_decl_flags and LTO_DECL_FLAG_FORCE_GLOBAL
> instead of lto_get_var_flags and LTO_VAR_FLAG_FORCE_GLOBAL
> respectively. Add code to force a static DECL to global if necessary.
> * varasm.c (assemble_variable): Use lto_get_decl_flags instead of
> lto_get_var_flags.
> * lto-utils.c (File): Replace all uses of lto_var_flags_t with
> lto_decl_flags_t.
> (lto_get_decl_flags): Renamed from lto_get_var_flags.
> (lto_set_decl_flags): Renamed from lto_set_var_flags.
> * lto-utils.h (File): Replace all lto_var_flags_* and LTO_VAR_FLAG_*
> with corresponding lto_decl_flags_* and LTO_DECL_FLAG_* respectively.
>
> lto/ChangeLog:
> * lto.c (lto_scan_statics_in_ref_table): New function factored out
> from code in ...
> (lto_scan_statics_in_cgraph_node): Handle both file-scope static
> variables and functions.
> (lto_promote_cross_file_statics): Rename bitmaps to SEEN_DECLS
> and GLOBAL_DECLS from SEEN_VARS and GLOBAL_VARS.
>
> testsuite/ChangeLog.lto:
> * gcc.dg/lto/20081202-1_0.c: New.
> * gcc.dg/lto/20081202-1_1.c: New.
> * gcc.dg/lto/20081202-2_0.c: New.
> * gcc.dg/lto/20081202-2_1.c: New.
>
OK.
Diego.