#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
static void remove_from_pending_weak_list PARAMS ((const char *));
#endif
+static void globalize_decl PARAMS ((tree));
static void maybe_assemble_visibility PARAMS ((tree));
static int in_named_entry_eq PARAMS ((const PTR, const PTR));
static hashval_t in_named_entry_hash PARAMS ((const PTR));
weak_global_object_name = name;
}
-#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
- if (DECL_WEAK (decl))
- {
-#ifdef ASM_WEAKEN_DECL
- ASM_WEAKEN_DECL (asm_out_file, decl, fnname, 0);
-#else
- ASM_WEAKEN_LABEL (asm_out_file, fnname);
-#endif
- /* Remove this function from the pending weak list so that
- we do not emit multiple .weak directives for it. */
- remove_from_pending_weak_list
- (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
- }
- else
-#endif
- ASM_GLOBALIZE_LABEL (asm_out_file, fnname);
+ globalize_decl (decl);
maybe_assemble_visibility (decl);
}
{
#ifdef ASM_EMIT_BSS
case asm_dest_bss:
+ globalize_decl (decl);
ASM_EMIT_BSS (decl, name, size, rounded);
break;
#endif
/* First make the assembler name(s) global if appropriate. */
if (TREE_PUBLIC (decl) && DECL_NAME (decl))
- {
-#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
- if (DECL_WEAK (decl))
- {
-#ifdef ASM_WEAKEN_DECL
- ASM_WEAKEN_DECL (asm_out_file, decl, name, 0);
-#else
- ASM_WEAKEN_LABEL (asm_out_file, name);
-#endif
- /* Remove this variable from the pending weak list so that
- we do not emit multiple .weak directives for it. */
- remove_from_pending_weak_list
- (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
- }
- else
-#endif
- ASM_GLOBALIZE_LABEL (asm_out_file, name);
- }
+ globalize_decl (decl);
/* Output any data that we will need to use the address of. */
if (DECL_INITIAL (decl) == error_mark_node)
}
#endif /* defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL) */
+/* Emit the assembly bits to indicate that DECL is globally visible. */
+
+static void
+globalize_decl (decl)
+ tree decl;
+{
+ const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+
+#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
+ if (DECL_WEAK (decl))
+ {
+#ifdef ASM_WEAKEN_DECL
+ ASM_WEAKEN_DECL (asm_out_file, decl, name, 0);
+#else
+ ASM_WEAKEN_LABEL (asm_out_file, name);
+#endif
+ /* Remove this function from the pending weak list so that
+ we do not emit multiple .weak directives for it. */
+ remove_from_pending_weak_list (name);
+ return;
+ }
+ /* else */
+#endif
+ ASM_GLOBALIZE_LABEL (asm_out_file, name);
+}
+
/* Emit an assembler directive to make the symbol for DECL an alias to
the symbol for TARGET. */
if (TREE_PUBLIC (decl))
{
-#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
- if (DECL_WEAK (decl))
- {
-#ifdef ASM_WEAKEN_DECL
- ASM_WEAKEN_DECL (asm_out_file, decl, name, 0);
-#else
- ASM_WEAKEN_LABEL (asm_out_file, name);
-#endif
- /* Remove this function from the pending weak list so that
- we do not emit multiple .weak directives for it. */
- remove_from_pending_weak_list
- (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
- }
- else
-#endif
- ASM_GLOBALIZE_LABEL (asm_out_file, name);
+ globalize_decl (decl);
maybe_assemble_visibility (decl);
}