OSDN Git Service

* c-pragma.h (HANDLE_PRAGMA_WEAK): Define iff ASM_WEAKEN_LABEL and
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jul 2001 12:55:19 +0000 (12:55 +0000)
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jul 2001 12:55:19 +0000 (12:55 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44072 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-pragma.h
gcc/config/mips/iris5.h
gcc/config/mips/iris6.h
gcc/defaults.h
gcc/doc/tm.texi
gcc/varasm.c

index 4846660..ce3195a 100644 (file)
@@ -1,3 +1,17 @@
+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.
index d15c3e5..89ee4a7 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
 
@@ -22,9 +22,9 @@ Boston, MA 02111-1307, USA.  */
 #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
 
index 59d172c..eab210f 100644 (file)
@@ -170,3 +170,26 @@ do {                                                       \
   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
index 6f45cbb..bec3414 100644 (file)
@@ -207,23 +207,6 @@ Boston, MA 02111-1307, USA.  */
 #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
index a1001b9..ed5be8b 100644 (file)
@@ -142,6 +142,18 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (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
index adf9870..6fcc3ba 100644 (file)
@@ -6423,7 +6423,8 @@ correct for most systems.
 @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.
index 8d7000c..76f1c67 100644 (file)
@@ -4773,11 +4773,7 @@ weak_finish ()
       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