if (strcmp (pbuf, "saveall") == 0)
pragma_saveall = 1;
- /* ??? This is deprecated. Use section attributes. */
+ /* ??? This is deprecated. Delete for gcc 2.8. */
if (strcmp (pbuf, "section") == 0)
{
+ warning ("#pragma section is deprecated, use section attributes");
while (c && !isalpha (c))
c = getc (file);
psize = 0;
c = getc (file);
}
pbuf[psize] = 0;
- named_section (pbuf);
+ named_section (NULL_TREE, pbuf);
}
ungetc (c, file);
return c;
} \
} \
-#if 0
-#define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) \
- do { named_section(".init"); fprintf(FILE,"\t.word\t%s\n", NAME); } while (0)
-#else
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
do { ctors_section(); \
fprintf(FILE, "\t%s\t_%s\n", ASM_WORD_OP, NAME); } while (0)
-#endif
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
do { dtors_section(); \
#define SDB_DEBUGGING_INFO
#define SDB_DELIM "\n"
-/* Assemble generic sections.
- This is currently only used to support section attributes. */
+/* A C statement to output something to the assembler file to switch to section
+ NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
+ NULL_TREE. Some target formats do not support arbitrary sections. Do not
+ define this macro in such cases. */
-#define ASM_OUTPUT_SECTION_NAME(FILE, NAME) \
- fprintf (FILE, ".section\t%s\n", NAME)
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
+ fprintf (FILE, "\t.section %s\n", NAME)
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
} \
}
-/* Assemble generic sections.
- This is currently only used to support section attributes. */
+/* A C statement to output something to the assembler file to switch to section
+ NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
+ NULL_TREE. Some target formats do not support arbitrary sections. Do not
+ define this macro in such cases. */
-#define ASM_OUTPUT_SECTION_NAME(FILE, NAME) \
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
do { fprintf (FILE, ".section\t%s\n", NAME); } while (0)
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
#define CTORS_SECTION_ASM_OP ".section\t\".ctors\",#alloc,#execinstr"
#define DTORS_SECTION_ASM_OP ".section\t\".dtors\",#alloc,#execinstr"
-/* Assemble generic sections.
- This is currently only used to support section attributes. */
-
-#define ASM_OUTPUT_SECTION_NAME(FILE, NAME) \
- fprintf (FILE, ".section\t\"%s\",#alloc\n", NAME)
+/* A C statement to output something to the assembler file to switch to section
+ NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
+ NULL_TREE. Some target formats do not support arbitrary sections. Do not
+ define this macro in such cases. */
+
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
+do { \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ fprintf (FILE, ".section\t\"%s\",#alloc,#execinstr\n", (NAME)); \
+ else if (TREE_READONLY (DECL)) \
+ fprintf (FILE, ".section\t\"%s\",#alloc\n", (NAME)); \
+ else \
+ fprintf (FILE, ".section\t\"%s\",#alloc,#write\n", (NAME)); \
+} while (0)
/* If the host and target formats match, output the floats as hex. */
#if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT