aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips/mips.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-08-17 11:57:51 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-08-17 11:57:51 -0700
commitf99ffb608b3069da8ac2b9f25c61c4b4ad77f571 (patch)
tree90b323eb19d0d77a62d5a276e6c63d57dc653568 /gcc/config/mips/mips.h
parent61f38a77a0c4f467c59707ce434d34eae52d6692 (diff)
downloadgcc-f99ffb608b3069da8ac2b9f25c61c4b4ad77f571.zip
gcc-f99ffb608b3069da8ac2b9f25c61c4b4ad77f571.tar.gz
gcc-f99ffb608b3069da8ac2b9f25c61c4b4ad77f571.tar.bz2
varasm.c (text_section): Allow TEXT_SECTION to override the printing of TEXT_SECTION_ASM_OP.
* varasm.c (text_section): Allow TEXT_SECTION to override the printing of TEXT_SECTION_ASM_OP. * dwarf2out.c (TEXT_SECTION_NAME): Rename from TEXT_SECTION. (DATA_SECTION, BSS_SECTION): Remove. * dwarfout.c (TEXT_SECTION_NAME, DATA_SECTION_NAME, DATA1_SECTION_NAME, RODATA_SECTION_NAME, RODATA1_SECTION_NAME, BSS_SECTION_NAME): Rename from s/_NAME//. * config/mips/mips.h (TARGET_FILE_SWITCHING): Add !TARGET_MIPS16. (ASM_DECLARE_FUNCTION_NAME): Move file switching ... (TEXT_SECTION): ... here. New. * config/mips/elf.h (TEXT_SECTION): New; no file switching. * config/mips/elf64.h, config/mips/netbsd.h: Likewise. * config/mips/openbsd.h: Likewise. * config/mips/mips.c (mips_asm_file_start): Tidy file switching test. (mips_asm_file_end): Likewise test. (mips_output_function_epilogue): Likewise. Switch back to data section after emitting the function. From-SVN: r44973
Diffstat (limited to 'gcc/config/mips/mips.h')
-rw-r--r--gcc/config/mips/mips.h40
1 files changed, 18 insertions, 22 deletions
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index c441198..d86cf1c 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -319,7 +319,8 @@ extern void sbss_section PARAMS ((void));
/* This is true if we must enable the assembly language file switching
code. */
-#define TARGET_FILE_SWITCHING (TARGET_GP_OPT && ! TARGET_GAS)
+#define TARGET_FILE_SWITCHING \
+ (TARGET_GP_OPT && ! TARGET_GAS && ! TARGET_MIPS16)
/* We must disable the function end stabs when doing the file switching trick,
because the Lscope stabs end up in the wrong place, making it impossible
@@ -4215,32 +4216,27 @@ while (0)
#define ASM_FILE_END(STREAM) mips_asm_file_end(STREAM)
+/* Play switch file games if we're optimizing the global pointer. */
+
+#undef TEXT_SECTION
+#define TEXT_SECTION() \
+do { \
+ extern FILE *asm_out_text_file; \
+ if (TARGET_FILE_SWITCHING) \
+ asm_out_file = asm_out_text_file; \
+ fputs (TEXT_SECTION_ASM_OP, asm_out_file); \
+ fputc ('\n', asm_out_file); \
+} while (0)
+
+
/* This is how to declare a function name. The actual work of
emitting the label is moved to function_prologue, so that we can
get the line number correctly emitted before the .ent directive,
- and after any .file directives.
-
- Also, switch files if we are optimizing the global pointer. */
+ and after any .file directives. */
#undef ASM_DECLARE_FUNCTION_NAME
-#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
-{ \
- extern FILE *asm_out_text_file; \
- if (TARGET_GP_OPT && ! TARGET_MIPS16) \
- { \
- STREAM = asm_out_text_file; \
- /* ??? text_section gets called too soon. If the previous \
- function is in a special section and we're not, we have \
- to switch back to the text section. We can't call \
- text_section again as gcc thinks we're already there. */ \
- /* ??? See varasm.c. There are other things that get output \
- too early, like alignment (before we've switched STREAM). */ \
- if (DECL_SECTION_NAME (DECL) == NULL_TREE) \
- fprintf (STREAM, "%s\n", TEXT_SECTION_ASM_OP); \
- } \
- \
- HALF_PIC_DECLARE (NAME); \
-}
+#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
+ HALF_PIC_DECLARE (NAME)
/* This is how to output an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. */