Commit 7e7be9c3 by Doug Evans

(ASM_OUTPUT_SECTION_NAME): New arg DECL.

From-SVN: r8461
parent 2ffe831c
...@@ -576,9 +576,10 @@ handle_pragma (file) ...@@ -576,9 +576,10 @@ handle_pragma (file)
if (strcmp (pbuf, "saveall") == 0) if (strcmp (pbuf, "saveall") == 0)
pragma_saveall = 1; pragma_saveall = 1;
/* ??? This is deprecated. Use section attributes. */ /* ??? This is deprecated. Delete for gcc 2.8. */
if (strcmp (pbuf, "section") == 0) if (strcmp (pbuf, "section") == 0)
{ {
warning ("#pragma section is deprecated, use section attributes");
while (c && !isalpha (c)) while (c && !isalpha (c))
c = getc (file); c = getc (file);
psize = 0; psize = 0;
...@@ -589,7 +590,7 @@ handle_pragma (file) ...@@ -589,7 +590,7 @@ handle_pragma (file)
c = getc (file); c = getc (file);
} }
pbuf[psize] = 0; pbuf[psize] = 0;
named_section (pbuf); named_section (NULL_TREE, pbuf);
} }
ungetc (c, file); ungetc (c, file);
return c; return c;
......
...@@ -1022,14 +1022,9 @@ dtors_section() \ ...@@ -1022,14 +1022,9 @@ dtors_section() \
} \ } \
} \ } \
#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) \ #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
do { ctors_section(); \ do { ctors_section(); \
fprintf(FILE, "\t%s\t_%s\n", ASM_WORD_OP, NAME); } while (0) fprintf(FILE, "\t%s\t_%s\n", ASM_WORD_OP, NAME); } while (0)
#endif
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
do { dtors_section(); \ do { dtors_section(); \
...@@ -1079,11 +1074,13 @@ dtors_section() \ ...@@ -1079,11 +1074,13 @@ dtors_section() \
#define SDB_DEBUGGING_INFO #define SDB_DEBUGGING_INFO
#define SDB_DELIM "\n" #define SDB_DELIM "\n"
/* Assemble generic sections. /* A C statement to output something to the assembler file to switch to section
This is currently only used to support section attributes. */ 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) \
fprintf (FILE, ".section\t%s\n", NAME) fprintf (FILE, "\t.section %s\n", NAME)
/* This is how to output the definition of a user-level label named 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. */ such as the label on a static function or variable NAME. */
......
...@@ -1244,10 +1244,12 @@ dtors_section() \ ...@@ -1244,10 +1244,12 @@ dtors_section() \
} \ } \
} }
/* Assemble generic sections. /* A C statement to output something to the assembler file to switch to section
This is currently only used to support section attributes. */ 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) do { fprintf (FILE, ".section\t%s\n", NAME); } while (0)
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
......
...@@ -175,11 +175,20 @@ do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \ ...@@ -175,11 +175,20 @@ do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \
#define CTORS_SECTION_ASM_OP ".section\t\".ctors\",#alloc,#execinstr" #define CTORS_SECTION_ASM_OP ".section\t\".ctors\",#alloc,#execinstr"
#define DTORS_SECTION_ASM_OP ".section\t\".dtors\",#alloc,#execinstr" #define DTORS_SECTION_ASM_OP ".section\t\".dtors\",#alloc,#execinstr"
/* Assemble generic sections. /* A C statement to output something to the assembler file to switch to section
This is currently only used to support section attributes. */ 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 ASM_OUTPUT_SECTION_NAME(FILE, NAME) \ define this macro in such cases. */
fprintf (FILE, ".section\t\"%s\",#alloc\n", NAME)
#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 the host and target formats match, output the floats as hex. */
#if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT #if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment