This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Remove TEXT_SECTION.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 10 Jan 2004 10:57:54 -0500 (EST)
- Subject: [patch] Remove TEXT_SECTION.
Hi,
Attached is a patch to remove TEXT_SECTION as it is unused.
AFAICT, TEXT_SECTION used to be a string constant like ".text". The
current C statement version of TEXT_SECTION was introduced by
http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01043.html
Then this patch
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00697.html
removed all uses of TEXT_SECTION.
Tested on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2004-01-10 Kazu Hirata <kazu@cs.umass.edu>
* system.h (TEXT_SECTION): Poison.
* varasm.c (text_section): Don't use TEXT_SECTION.
* config/sh/sh.c (sh_file_start): Fix a comment typo.
* doc/tm.texi (TEXT_SECTION): Remove.
Index: system.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/system.h,v
retrieving revision 1.181
diff -u -r1.181 system.h
--- system.h 9 Jan 2004 15:33:43 -0000 1.181
+++ system.h 10 Jan 2004 05:36:40 -0000
@@ -622,7 +622,7 @@
LIBGCC_NEEDS_DOUBLE FINAL_PRESCAN_LABEL DEFAULT_CALLER_SAVES \
LOAD_ARGS_REVERSED MAX_INTEGER_COMPUTATION_MODE \
CONVERT_HARD_REGISTER_TO_SSA_P ASM_OUTPUT_MAIN_SOURCE_FILENAME \
- FIRST_INSN_ADDRESS
+ FIRST_INSN_ADDRESS TEXT_SECTION
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.402
diff -u -r1.402 varasm.c
--- varasm.c 6 Jan 2004 16:51:21 -0000 1.402
+++ varasm.c 10 Jan 2004 05:36:42 -0000
@@ -234,11 +234,7 @@
if (in_section != in_text)
{
in_section = in_text;
-#ifdef TEXT_SECTION
- TEXT_SECTION ();
-#else
fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
-#endif
}
}
Index: config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.242
diff -u -r1.242 sh.c
--- config/sh/sh.c 6 Jan 2004 04:21:52 -0000 1.242
+++ config/sh/sh.c 10 Jan 2004 05:36:48 -0000
@@ -1336,7 +1336,7 @@
if (TARGET_ELF)
/* We need to show the text section with the proper
attributes as in TEXT_SECTION_ASM_OP, before dwarf2out
- emits it without attributes in TEXT_SECTION, else GAS
+ emits it without attributes in TEXT_SECTION_ASM_OP, else GAS
will complain. We can teach GAS specifically about the
default attributes for our choice of text section, but
then we would have to change GAS again if/when we change
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.276
diff -u -r1.276 tm.texi
--- doc/tm.texi 30 Dec 2003 20:27:53 -0000 1.276
+++ doc/tm.texi 10 Jan 2004 05:36:55 -0000
@@ -5736,13 +5736,6 @@
Normally @code{"\t.text"} is right.
@end defmac
-@defmac TEXT_SECTION
-A C statement that switches to the default section containing instructions.
-Normally this is not needed, as simply defining @code{TEXT_SECTION_ASM_OP}
-is enough. The MIPS port uses this to sort all functions after all data
-declarations.
-@end defmac
-
@defmac HOT_TEXT_SECTION_NAME
If defined, a C string constant for the name of the section containing most
frequently executed functions of the program. If not defined, GCC will provide