+2001-07-17 H.J. Lu <hjl@gnu.org>
+ Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * c-pragma.h (HANDLE_PRAGMA_WEAK): Define iff ASM_WEAKEN_LABEL and
+ ASM_OUTPUT_WEAK_ALIAS are defined.
+ * defaults.h (ASM_OUTPUT_WEAK_ALIAS): Define if possible.
+ * config/mips/iris6.h (ASM_OUTPUT_WEAK_ALIAS, ASM_WEAKEN_LABEL):
+ Moved ...
+ * config/mips/iris5.h: ... here.
+ (HANDLE_SYSV_PRAGMA): Defined as 1.
+ * varasm.c (weak_finish): Use ASM_OUTPUT_WEAK_ALIAS.
+ * doc/tm.texi (ASM_OUTPUT_WEAK_ALIAS): Support the undefined weak
+ symbol.
+
2001-07-17 Joseph S. Myers <jsm28@cam.ac.uk>
* c-parse.in (all_prefix_attributes): New variable.
/* Pragma related interfaces.
- Copyright (C) 1995, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
#define GCC_C_PRAGMA_H
#ifdef HANDLE_SYSV_PRAGMA
-/* Support #pragma weak iff ASM_WEAKEN_LABEL and ASM_OUTPUT_DEF are
+/* Support #pragma weak iff ASM_WEAKEN_LABEL and ASM_OUTPUT_WEAK_ALIAS are
defined. */
-#if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
+#if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_WEAK_ALIAS)
#define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
#endif
tree name_tree = get_identifier (NAME); \
TREE_ASM_WRITTEN (name_tree) = 1; \
} while (0)
+
+/* This is how we tell the assembler that a symbol is weak. */
+
+#define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE) \
+ do \
+ { \
+ ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ fputs ("\t.weakext\t", FILE); \
+ assemble_name (FILE, NAME); \
+ if (VALUE) \
+ { \
+ fputc (' ', FILE); \
+ assemble_name (FILE, VALUE); \
+ } \
+ fputc ('\n', FILE); \
+ } \
+ while (0)
+
+#define ASM_WEAKEN_LABEL(FILE, NAME) ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, 0)
+
+/* Handle #pragma weak and #pragma pack. */
+#undef HANDLE_SYSV_PRAGMA
+#define HANDLE_SYSV_PRAGMA 1
#define TYPE_ASM_OP "\t.type\t"
#define SIZE_ASM_OP "\t.size\t"
-/* This is how we tell the assembler that a symbol is weak. */
-
-#define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
- do { \
- ASM_GLOBALIZE_LABEL (FILE, NAME); \
- fputs ("\t.weakext\t", FILE); \
- assemble_name (FILE, NAME); \
- if (VALUE) \
- { \
- fputc (' ', FILE); \
- assemble_name (FILE, VALUE); \
- } \
- fputc ('\n', FILE); \
- } while (0)
-
-#define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,0)
-
/* Irix assembler does not support the init_priority C++ attribute. */
#undef SUPPORTS_INIT_PRIORITY
#define SUPPORTS_INIT_PRIORITY 0
ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
#endif
+/* This is how we tell the assembler that a symbol is weak. */
+#if !defined (ASM_OUTPUT_WEAK_ALIAS) && defined (ASM_OUTPUT_DEF)
+#define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE) \
+ do \
+ { \
+ ASM_WEAKEN_LABEL (STREAM, NAME); \
+ if (VALUE) \
+ ASM_OUTPUT_DEF (STREAM, NAME, VALUE); \
+ } \
+ while (0)
+#endif
+
/* This determines whether or not we support weak symbols. */
#ifndef SUPPORTS_WEAK
#ifdef ASM_WEAKEN_LABEL
@item ASM_OUTPUT_WEAK_ALIAS (@var{stream}, @var{name}, @var{value})
A C statement to output to the stdio stream @var{stream} assembler code
which defines (equates) the weak symbol @var{name} to have the value
-@var{value}.
+@var{value}. If @var{value} is @code{NULL}, it defines @var{name} as
+an undefined weak symbol.
Define this macro if the target only supports weak aliases; define
@code{ASM_OUTPUT_DEF} instead if possible.
for (t = weak_decls; t; t = t->next)
{
if (t->name)
- {
- ASM_WEAKEN_LABEL (asm_out_file, t->name);
- if (t->value)
- ASM_OUTPUT_DEF (asm_out_file, t->name, t->value);
- }
+ ASM_OUTPUT_WEAK_ALIAS (asm_out_file, t->name, t->value);
}
}
#endif