Commit 5d7f4d9c by Jan Hubicka Committed by Jan Hubicka

lto-streamer-out.c (write_symbol): Fix visibilities of external references.


	* lto-streamer-out.c (write_symbol): Fix visibilities of external
	references.

From-SVN: r162497
parent 67d8bd24
2010-07-23 Jan Hubicka <jh@suse.cz>
* lto-streamer-out.c (write_symbol): Fix visibilities of external
references.
2010-07-23 Le-Chun Wu <lcwu@google.com> 2010-07-23 Le-Chun Wu <lcwu@google.com>
* omega.c (omega_eliminate_redundant): Remove a self-assign statement. * omega.c (omega_eliminate_redundant): Remove a self-assign statement.
......
...@@ -2352,21 +2352,32 @@ write_symbol (struct lto_streamer_cache_d *cache, ...@@ -2352,21 +2352,32 @@ write_symbol (struct lto_streamer_cache_d *cache,
&& cgraph_get_node (t)->analyzed)); && cgraph_get_node (t)->analyzed));
} }
switch (DECL_VISIBILITY(t)) /* Imitate what default_elf_asm_output_external do.
{ When symbol is external, we need to output it with DEFAULT visibility
case VISIBILITY_DEFAULT: when compiling with -fvisibility=default, while with HIDDEN visibility
visibility = GCCPV_DEFAULT; when symbol has attribute (visibility("hidden")) specified.
break; targetm.binds_local_p check DECL_VISIBILITY_SPECIFIED and gets this
case VISIBILITY_PROTECTED: right. */
visibility = GCCPV_PROTECTED;
break; if (DECL_EXTERNAL (t)
case VISIBILITY_HIDDEN: && !targetm.binds_local_p (t))
visibility = GCCPV_HIDDEN; visibility = GCCPV_DEFAULT;
break; else
case VISIBILITY_INTERNAL: switch (DECL_VISIBILITY(t))
visibility = GCCPV_INTERNAL; {
break; case VISIBILITY_DEFAULT:
} visibility = GCCPV_DEFAULT;
break;
case VISIBILITY_PROTECTED:
visibility = GCCPV_PROTECTED;
break;
case VISIBILITY_HIDDEN:
visibility = GCCPV_HIDDEN;
break;
case VISIBILITY_INTERNAL:
visibility = GCCPV_INTERNAL;
break;
}
if (kind == GCCPK_COMMON if (kind == GCCPK_COMMON
&& DECL_SIZE (t) && DECL_SIZE (t)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment