* varasm.c (text_section): Use TEXT_SECTION_ASM_OP and
ASM_OUTPUT_ALIGN instead of SECTION_FORMAT_STRING
and NORMAL_TEXT_SECTION_NAME.
(unlikely_text_section): Check targetm.have_named_sections
instead of TARGET_ASM_NAMED_SECTION and use TEXT_SECTION_ASM_OP
instead of SECTION_FORMAT_STRING.
* config/mips/iris5.h (current_section_name): Add
in_unlikely_executed_text case and move the abort into the switch.
* config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME): Remove.
(NORMAL_TEXT_SECTION_NAME): Remove.
(UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
(SECTION_FORMAT_STRING): Remove.
* defaults.h (SECTION_FORMAT_STRING): Remove.
* tm.texi (NORMAL_TEXT_SECTION_NAME): Remove.
(SECTION_FORMAT_STRING): Remove.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80593
138bc75d-0d04-0410-961f-
82ee72b054a4
+2004-04-11 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * varasm.c (text_section): Use TEXT_SECTION_ASM_OP and
+ ASM_OUTPUT_ALIGN instead of SECTION_FORMAT_STRING
+ and NORMAL_TEXT_SECTION_NAME.
+ (unlikely_text_section): Check targetm.have_named_sections
+ instead of TARGET_ASM_NAMED_SECTION and use TEXT_SECTION_ASM_OP
+ instead of SECTION_FORMAT_STRING.
+ * config/mips/iris5.h (current_section_name): Add
+ in_unlikely_executed_text case and move the abort into the switch.
+ * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME): Remove.
+ (NORMAL_TEXT_SECTION_NAME): Remove.
+ (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
+ (SECTION_FORMAT_STRING): Remove.
+ * defaults.h (SECTION_FORMAT_STRING): Remove.
+ * tm.texi (NORMAL_TEXT_SECTION_NAME): Remove.
+ (SECTION_FORMAT_STRING): Remove.
+
2004-04-10 Joseph S. Myers <jsm@polyomino.org.uk>
* c-typeck.c (common_type): Prefer long long to long when same
switch (in_section) \
{ \
case no_section: return NULL; \
+ case in_unlikely_executed_text: \
case in_text: return ".text"; \
case in_data: return ".data"; \
case in_bss: return ".bss"; \
return ".rdata"; \
case in_named: \
return in_named_name; \
+ default: abort(); \
} \
- abort (); \
} \
\
unsigned int \
#define BSS_SECTION_ASM_OP "\t.section\t\".bss\""
-#define HOT_TEXT_SECTION_NAME ".text"
-#define NORMAL_TEXT_SECTION_NAME ".text"
-#define UNLIKELY_EXECUTED_TEXT_SECTION_NAME ".text.unlikely"
-#define SECTION_FORMAT_STRING ".section\t\"%s\"\n\t.align 2\n"
-
/* Override elfos.h definition. */
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
#define UNLIKELY_EXECUTED_TEXT_SECTION_NAME "text.unlikely"
#endif
-#ifndef SECTION_FORMAT_STRING
-#define SECTION_FORMAT_STRING "\t.section\t%s\n\t.align 2\n"
-#endif
-
#ifndef HAS_LONG_COND_BRANCH
#define HAS_LONG_COND_BRANCH 0
#endif
a default definition if the target supports named sections.
@end defmac
-@defmac NORMAL_TEXT_SECTION_NAME
-If defined, a C string constant for the name of the section containing code
-that does not go into the ``unlikely executed text'' partition. This is used
-as part of the optimization that partitions hot and cold basic blocks into
-separate sections in the .o and executable files.
-@end defmac
-
@defmac UNLIKELY_EXECUTED_TEXT_SECTION_NAME
If defined, a C string constant for the name of the section containing unlikely
executed functions in the program.
not exist.
@end defmac
-@defmac SECTION_FORMAT_STRING
-If defined, format string used by fprintf to write out the
-text section headers for the hot and cold sections of the
-assembly file, when hot and cold partitioning is being performed.
-@end defmac
-
@defmac CRT_CALL_STATIC_FUNCTION (@var{section_op}, @var{function})
If defined, an ASM statement that switches to a different section
via @var{section_op}, calls @var{function}, and switches back to
if (in_section != in_text)
{
in_section = in_text;
- fprintf (asm_out_file, SECTION_FORMAT_STRING, NORMAL_TEXT_SECTION_NAME);
+ fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
+ ASM_OUTPUT_ALIGN (asm_out_file, 2);
}
}
&& (in_section != in_named
|| strcmp (in_named_name, UNLIKELY_EXECUTED_TEXT_SECTION_NAME) != 0))
{
-#ifdef TARGET_ASM_NAMED_SECTION
-
- named_section (NULL_TREE, UNLIKELY_EXECUTED_TEXT_SECTION_NAME, 0);
+ if (targetm.have_named_sections)
+ named_section (NULL_TREE, UNLIKELY_EXECUTED_TEXT_SECTION_NAME, 0);
+ else
+ {
+ in_section = in_unlikely_executed_text;
+ fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
+ ASM_OUTPUT_ALIGN (asm_out_file, 2);
+ }
-#else
- in_section = in_unlikely_executed_text;
- fprintf (asm_out_file, SECTION_FORMAT_STRING,
- UNLIKELY_EXECUTED_TEXT_SECTION_NAME);
-#endif /* ifdef TARGET_ASM_NAMED_SECTION */
if (!unlikely_section_label_printed)
{
fprintf (asm_out_file, "__%s_unlikely_section:\n",