aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-05-20 21:57:45 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-05-20 19:57:45 +0000
commitcf288ed3b8b0cdfee1c03a7dfb2d371b5b7e3147 (patch)
treec7cb5df0ad4b66323aabee83001d4e28934f6229 /gcc/varasm.c
parentf4cd9c518ba414724bacb1d936ba1676929fa52e (diff)
downloadgcc-cf288ed3b8b0cdfee1c03a7dfb2d371b5b7e3147.zip
gcc-cf288ed3b8b0cdfee1c03a7dfb2d371b5b7e3147.tar.gz
gcc-cf288ed3b8b0cdfee1c03a7dfb2d371b5b7e3147.tar.bz2
tree.h (DECL_ONE_ONLY): Return true only for externally visible symbols.
* tree.h (DECL_ONE_ONLY): Return true only for externally visible symbols. * except.c (switch_to_exception_section, resolve_unique_section, get_named_text_section, default_function_rodata_section, align_variable, get_block_for_decl, default_section_type_flags): Use DECL_COMDAT_GROUP instead of DECL_ONE_ONLY. * symtab.c (symtab_add_to_same_comdat_group, symtab_make_decl_local, fixup_same_cpp_alias_visibility, symtab_nonoverwritable_alias, symtab_get_symbol_partitioning_class): Likewise. * cgraphclones.c (cgraph_create_virtual_clone): Likewise. * bb-reorder.c (pass_partition_blocks::gate): Likewise. * config/c6x/c6x.c (c6x_elf_unique_section): Likewise. (c6x_function_in_section_p): Likewise. * config/darwin.c (machopic_select_section): Likewise. * config/arm/arm.c (arm_function_in_section_p): Likewise. * config/mips/mips.c (mips_function_rodata_section): Likewise. * config/mep/mep.c (mep_select_section): LIkewise. * config/i386/i386.c (x86_64_elf_unique_section): Likewise. From-SVN: r210654
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 9886652..6781096 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -428,7 +428,7 @@ resolve_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED,
if (DECL_SECTION_NAME (decl) == NULL_TREE
&& targetm_common.have_named_sections
&& (flag_function_or_data_sections
- || DECL_ONE_ONLY (decl)))
+ || DECL_COMDAT_GROUP (decl)))
{
targetm.asm_out.unique_section (decl, reloc);
DECL_HAS_IMPLICIT_SECTION_NAME_P (decl) = true;
@@ -517,7 +517,7 @@ get_named_text_section (tree decl,
/* Do not try to split gnu_linkonce functions. This gets somewhat
slipperly. */
- if (DECL_ONE_ONLY (decl) && !HAVE_COMDAT_GROUP)
+ if (DECL_COMDAT_GROUP (decl) && !HAVE_COMDAT_GROUP)
return NULL;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
name = targetm.strip_name_encoding (name);
@@ -687,7 +687,7 @@ default_function_rodata_section (tree decl)
{
const char *name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
- if (DECL_ONE_ONLY (decl) && HAVE_COMDAT_GROUP)
+ if (DECL_COMDAT_GROUP (decl) && HAVE_COMDAT_GROUP)
{
const char *dot;
size_t len;
@@ -704,7 +704,7 @@ default_function_rodata_section (tree decl)
return get_section (rname, SECTION_LINKONCE, decl);
}
/* For .gnu.linkonce.t.foo we want to use .gnu.linkonce.r.foo. */
- else if (DECL_ONE_ONLY (decl)
+ else if (DECL_COMDAT_GROUP (decl)
&& strncmp (name, ".gnu.linkonce.t.", 16) == 0)
{
size_t len = strlen (name) + 1;
@@ -996,7 +996,8 @@ align_variable (tree decl, bool dont_output_data)
and for code accessing the variable as guaranteed alignment, we
can only increase the alignment if it is a performance optimization
if the references to it must bind to the current definition. */
- if (decl_binds_to_current_def_p (decl))
+ if (decl_binds_to_current_def_p (decl)
+ && !DECL_VIRTUAL_P (decl))
{
#ifdef DATA_ALIGNMENT
unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
@@ -1142,7 +1143,7 @@ get_block_for_decl (tree decl)
/* There's no point using object blocks for something that is
isolated by definition. */
- if (DECL_ONE_ONLY (decl))
+ if (DECL_COMDAT_GROUP (decl))
return NULL;
}
@@ -6076,7 +6077,7 @@ default_section_type_flags (tree decl, const char *name, int reloc)
flags |= SECTION_RELRO;
}
- if (decl && DECL_P (decl) && DECL_ONE_ONLY (decl))
+ if (decl && DECL_P (decl) && DECL_COMDAT_GROUP (decl))
flags |= SECTION_LINKONCE;
if (strcmp (name, ".vtable_map_vars") == 0)