static GTY(()) section *unnamed_sections;
/* Return a nonzero value if DECL has a section attribute. */
-#ifndef IN_NAMED_SECTION
#define IN_NAMED_SECTION(DECL) \
((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
&& DECL_SECTION_NAME (DECL) != NULL_TREE)
-#endif
/* Hash table of named sections. */
static GTY((param_is (section))) htab_t section_htab;
/* Specifying a section attribute on a variable forces it into a
non-.bss section, and thus it cannot be common. */
- gcc_assert (!(TREE_CODE (decl) == VAR_DECL
- && DECL_SECTION_NAME (decl) != NULL_TREE
- && DECL_INITIAL (decl) == NULL_TREE
- && DECL_COMMON (decl))
- || !DECL_COMMON (decl));
+ /* FIXME: In general this code should not be necessary because
+ visibility pass is doing the same work. But notice_global_symbol
+ is called early and it needs to make DECL_RTL to get the name.
+ we take care of recomputing the DECL_RTL after visibility is changed. */
+ if (TREE_CODE (decl) == VAR_DECL
+ && DECL_SECTION_NAME (decl) != NULL_TREE
+ && DECL_INITIAL (decl) == NULL_TREE
+ && DECL_COMMON (decl))
+ DECL_COMMON (decl) = 0;
/* Variables can't be both common and weak. */
- gcc_assert (TREE_CODE (decl) != VAR_DECL
- || !DECL_WEAK (decl)
- || !DECL_COMMON (decl));
+ if (TREE_CODE (decl) == VAR_DECL && DECL_WEAK (decl))
+ DECL_COMMON (decl) = 0;
if (use_object_blocks_p () && use_blocks_for_decl_p (decl))
x = create_block_symbol (name, get_block_for_decl (decl), -1);
the visibility type VIS, which must not be VISIBILITY_DEFAULT. */
void
-default_assemble_visibility (tree decl, int vis)
+default_assemble_visibility (tree decl ATTRIBUTE_UNUSED,
+ int vis ATTRIBUTE_UNUSED)
{
+#ifdef HAVE_GAS_HIDDEN
static const char * const visibility_types[] = {
NULL, "protected", "hidden", "internal"
};
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
type = visibility_types[vis];
-#ifdef HAVE_GAS_HIDDEN
fprintf (asm_out_file, "\t.%s\t", type);
assemble_name (asm_out_file, name);
fprintf (asm_out_file, "\n");
gcc_unreachable ();
}
+#ifndef TLS_SECTION_ASM_FLAG
+#define TLS_SECTION_ASM_FLAG 'T'
+#endif
+
void
default_elf_asm_named_section (const char *name, unsigned int flags,
tree decl ATTRIBUTE_UNUSED)
if (flags & SECTION_STRINGS)
*f++ = 'S';
if (flags & SECTION_TLS)
- *f++ = 'T';
+ *f++ = TLS_SECTION_ASM_FLAG;
if (HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE))
*f++ = 'G';
*f = '\0';