mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-24 11:22:58 +08:00
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
This commit is contained in:
parent
67d8bd24cd
commit
5d7f4d9c8b
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
* omega.c (omega_eliminate_redundant): Remove a self-assign statement.
|
||||
|
@ -2352,21 +2352,32 @@ write_symbol (struct lto_streamer_cache_d *cache,
|
||||
&& cgraph_get_node (t)->analyzed));
|
||||
}
|
||||
|
||||
switch (DECL_VISIBILITY(t))
|
||||
{
|
||||
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;
|
||||
}
|
||||
/* Imitate what default_elf_asm_output_external do.
|
||||
When symbol is external, we need to output it with DEFAULT visibility
|
||||
when compiling with -fvisibility=default, while with HIDDEN visibility
|
||||
when symbol has attribute (visibility("hidden")) specified.
|
||||
targetm.binds_local_p check DECL_VISIBILITY_SPECIFIED and gets this
|
||||
right. */
|
||||
|
||||
if (DECL_EXTERNAL (t)
|
||||
&& !targetm.binds_local_p (t))
|
||||
visibility = GCCPV_DEFAULT;
|
||||
else
|
||||
switch (DECL_VISIBILITY(t))
|
||||
{
|
||||
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
|
||||
&& DECL_SIZE (t)
|
||||
|
Loading…
Reference in New Issue
Block a user