varasm.c (UNIQUE_SECTION): Move default implementation ...
authorRichard Henderson <rth@gcc.gnu.org>
Tue, 23 Jan 2001 22:29:30 +0000 (14:29 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 23 Jan 2001 22:29:30 +0000 (14:29 -0800)
        * varasm.c (UNIQUE_SECTION): Move default implementation ...
        * defaults.h: ... here.

From-SVN: r39213

gcc/defaults.h
gcc/varasm.c

index 2aa5218d464180ef1f2b39c31779ea9fd8f9baa3..b0f3ce9fa6df097b38a0b8a8bda18c3485ca5769 100644 (file)
@@ -1,6 +1,4 @@
-/* Definitions of various defaults for how to do assembler output
-   (most of which are designed to be appropriate for GAS or for
-   some BSD assembler).
+/* Definitions of various defaults for tm.h macros.
    Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
    Contributed by Ron Guilmette (rfg@monkeys.com)
@@ -192,6 +190,33 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
 # endif
 #endif
 
+/* If we have no definition for UNIQUE_SECTION, but do have the 
+   ability to generate arbitrary sections, construct something
+   reasonable.  */
+#ifdef ASM_OUTPUT_SECTION_NAME
+#ifndef UNIQUE_SECTION
+#define UNIQUE_SECTION(DECL,RELOC)                             \
+do {                                                           \
+  int len;                                                     \
+  const char *name;                                            \
+  char *string;                                                        \
+                                                               \
+  name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));      \
+  /* Strip off any encoding in name.  */                       \
+  STRIP_NAME_ENCODING (name, name);                            \
+                                                               \
+  len = strlen (name) + 1;                                     \
+  string = alloca (len + 1);                                   \
+  sprintf (string, ".%s", name);                               \
+                                                               \
+  DECL_SECTION_NAME (DECL) = build_string (len, string);       \
+} while (0)
+#endif
+#ifndef UNIQUE_SECTION_P
+#define UNIQUE_SECTION_P(DECL) 0
+#endif
+#endif
+
 /* By default, we generate a label at the beginning and end of the
    text section, and compute the size of the text section by
    subtracting the two.  However, on some platforms that doesn't 
index 0cdf138485f812473e8947e17321a890d5eae6ef..99c8da691d9692b001546c2321bf9154e2cb057b 100644 (file)
@@ -326,30 +326,6 @@ named_section (decl, name, reloc)
     }
 }
 
-#ifdef ASM_OUTPUT_SECTION_NAME
-#ifndef UNIQUE_SECTION
-#define UNIQUE_SECTION(DECL,RELOC)                             \
-do {                                                           \
-  int len;                                                     \
-  const char *name;                                            \
-  char *string;                                                        \
-                                                               \
-  name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));      \
-  /* Strip off any encoding in name.  */                       \
-  STRIP_NAME_ENCODING (name, name);                            \
-                                                               \
-  len = strlen (name) + 1;                                     \
-  string = alloca (len + 1);                                   \
-  sprintf (string, ".%s", name);                               \
-                                                               \
-  DECL_SECTION_NAME (DECL) = build_string (len, string);       \
-} while (0)
-#endif
-#ifndef UNIQUE_SECTION_P
-#define UNIQUE_SECTION_P(DECL) 0
-#endif
-#endif
-
 #ifdef BSS_SECTION_ASM_OP
 
 /* Tell the assembler to switch to the bss section.  */