This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: ASM_SECTION_END
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH: ASM_SECTION_END
- From: Lars Brinkhoff <lars at nocrew dot org>
- Date: 07 Feb 2001 12:23:20 +0100
A target may have to do some machine-specific actions to tell the
assembler to end the current section. This patch provides an
ASM_SECTION_END macro to enable such actions.
I believe this is safe to apply, but submit it mostly for review.
2001-02-07 lars brinkhoff <lars@nocrew.org>
* varasm.c (text_section): call ASM_SECTION_END if defined.
(data_section): likewise.
(named_section): likewise.
(bss_section): likewise.
(eh_frame_section): likewise.
* tm.texi (ASM_SECTION_END): document it.
Index: tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tm.texi,v
retrieving revision 1.170
diff -u -r1.170 tm.texi
--- tm.texi 2001/02/07 10:42:15 1.170
+++ tm.texi 2001/02/07 11:08:46
@@ -5247,6 +5247,12 @@
finalization code. If not defined, GCC will assume such a section does
not exist.
+@findex ASM_SECTION_END
+@item ASM_SECTION_END (@var{stream})
+If defined, a C expression to output to the stdio stream @var{stream}
+anything needed to end the current section. If not defined, nothing
+will be output.
+
@findex CRT_CALL_STATIC_FUNCTION
@item CRT_CALL_STATIC_FUNCTION
If defined, a C statement that calls the function named as the sole
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.161
diff -u -r1.161 varasm.c
--- varasm.c 2001/02/04 08:29:46 1.161
+++ varasm.c 2001/02/07 11:08:48
@@ -228,6 +228,9 @@
{
if (in_section != in_text)
{
+#ifdef ASM_SECTION_END
+ ASM_SECTION_END (asm_out_file);
+#endif
fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
in_section = in_text;
}
@@ -240,6 +243,9 @@
{
if (in_section != in_data)
{
+#ifdef ASM_SECTION_END
+ ASM_SECTION_END (asm_out_file);
+#endif
if (flag_shared_data)
{
#ifdef SHARED_SECTION_ASM_OP
@@ -312,6 +318,9 @@
if (in_section != in_named || strcmp (name, in_named_name))
{
#ifdef ASM_OUTPUT_SECTION_NAME
+#ifdef ASM_SECTION_END
+ ASM_SECTION_END (asm_out_file);
+#endif
ASM_OUTPUT_SECTION_NAME (asm_out_file, decl, name, reloc);
#else
/* Section attributes are not supported if this macro isn't provided -
@@ -334,6 +343,9 @@
{
if (in_section != in_bss)
{
+#ifdef ASM_SECTION_END
+ ASM_SECTION_END (asm_out_file);
+#endif
#ifdef SHARED_BSS_SECTION_ASM_OP
if (flag_shared_data)
fprintf (asm_out_file, "%s\n", SHARED_BSS_SECTION_ASM_OP);
@@ -410,6 +422,9 @@
{
if (in_section != in_eh_frame)
{
+#ifdef ASM_SECTION_END
+ ASM_SECTION_END (asm_out_file);
+#endif
fprintf (asm_out_file, "%s\n", EH_FRAME_SECTION_ASM_OP);
in_section = in_eh_frame;
}