+Mon Jun 7 20:34:20 1999 Robert Lipe <robertlipe@usa.net>
+ Jeffrey A Law (law@cygnus.com)
+
+ * varasm.c (assemble_start_function): Remove the function
+ from the pending weak decls list when we define a function.
+ (assemble_variable): Similarly for variables.
+ (weak_finish): Ignore items on the list with a NULL name.
+ (remove_from_ending_weak_list); New function to "remove" an item
+ from the pending weak declarations list.
+
Mon Jun 7 19:27:07 1999 Jerry Quinn <jquinn@nortelnetworks.com>
* pa.md (fmpyfadd, fmpynfadd, fnegabs): New patterns.
static int output_addressed_constants PROTO((tree));
static void output_after_function_constants PROTO((void));
static void output_constructor PROTO((tree, int));
+static void remove_from_pending_weak_list PROTO ((char *));
#ifdef ASM_OUTPUT_BSS
static void asm_output_bss PROTO((FILE *, tree, char *, int, int));
#endif
#ifdef ASM_WEAKEN_LABEL
if (DECL_WEAK (decl))
- ASM_WEAKEN_LABEL (asm_out_file, fnname);
+ {
+ ASM_WEAKEN_LABEL (asm_out_file, fnname);
+ /* 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);
if (TREE_PUBLIC (decl) && DECL_NAME (decl))
{
#ifdef ASM_WEAKEN_LABEL
- if (DECL_WEAK (decl))
- ASM_WEAKEN_LABEL (asm_out_file, name);
+ if (DECL_WEAK (decl))
+ {
+ ASM_WEAKEN_LABEL (asm_out_file, name);
+ /* 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);
struct weak_syms *t;
for (t = weak_decls; t; t = t->next)
{
- ASM_WEAKEN_LABEL (asm_out_file, t->name);
- if (t->value)
- ASM_OUTPUT_DEF (asm_out_file, t->name, t->value);
+ if (t->name)
+ {
+ ASM_WEAKEN_LABEL (asm_out_file, t->name);
+ if (t->value)
+ ASM_OUTPUT_DEF (asm_out_file, t->name, t->value);
+ }
+ }
+ }
+#endif
+}
+
+/* Remove NAME from the pending list of weak symbols. This prevents
+ the compiler from emitting multiple .weak directives which confuses
+ some assemblers. */
+static void
+remove_from_pending_weak_list (name)
+ char *name;
+{
+#ifdef HANDLE_PRAGMA_WEAK
+ if (HANDLE_PRAGMA_WEAK)
+ {
+ struct weak_syms *t;
+ for (t = weak_decls; t; t = t->next)
+ {
+ if (strcmp (name, t->name) == 0)
+ t->name = NULL;
}
}
#endif
{
#ifdef ASM_WEAKEN_LABEL
if (DECL_WEAK (decl))
- ASM_WEAKEN_LABEL (asm_out_file, name);
+ {
+ ASM_WEAKEN_LABEL (asm_out_file, name);
+ /* 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);