This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Remove ASM_OUTPUT_SECTION_NAME.


Hi Richard,

> On Thu, Jan 15, 2004 at 04:24:42PM -0500, Kazu Hirata wrote:
> > 	* ada/utils.c (process_attributes): Don't use
> > 	ASM_OUTPUT_SECTION_NAME.
> 
> This is not correct.  The code should be checking
> targetm.have_named_sections.
> 
> > 	* config/alpha/unicosmk.h: Remove a commented-out definition
> > 	of ASM_OUTPUT_SECTION_NAME.
> > 	* config/stormy16/stormy16.h: Likewise.
> 
> These are ok.

I updated the patch like so.

Bootstrapped on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2004-01-16  Kazu Hirata  <kazu@cs.umass.edu>

	* system.h (ASM_OUTPUT_SECTION_NAME): Poison.
	* config/alpha/unicosmk.h: Remove a commented-out definition
	of ASM_OUTPUT_SECTION_NAME.
	* config/stormy16/stormy16.h: Likewise.

2004-01-16  Kazu Hirata  <kazu@cs.umass.edu>

	* Make-lang.in (utils.o): Depend on target.h.
	* utils.c: Include target.h.
	(process_attributes): Use targetm.have_named_sections instead
	of ASM_OUTPUT_SECTION_NAME.

Index: system.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/system.h,v
retrieving revision 1.188
diff -u -r1.188 system.h
--- system.h	16 Jan 2004 16:59:17 -0000	1.188
+++ system.h	16 Jan 2004 18:49:02 -0000
@@ -595,7 +595,8 @@
 	INIT_GOFAST_OPTABS MULSI3_LIBCALL MULDI3_LIBCALL DIVSI3_LIBCALL \
 	DIVDI3_LIBCALL UDIVSI3_LIBCALL UDIVDI3_LIBCALL MODSI3_LIBCALL	\
 	MODDI3_LIBCALL UMODSI3_LIBCALL UMODDI3_LIBCALL BUILD_VA_LIST_TYPE \
-	PRETEND_OUTGOING_VARARGS_NAMED STRUCT_VALUE_INCOMING_REGNUM
+	PRETEND_OUTGOING_VARARGS_NAMED STRUCT_VALUE_INCOMING_REGNUM	\
+	ASM_OUTPUT_SECTION_NAME
 
 /* Other obsolete target macros, or macros that used to be in target
    headers and were not used, and may be obsolete or may never have
Index: ada/Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/Make-lang.in,v
retrieving revision 1.70
diff -u -r1.70 Make-lang.in
--- ada/Make-lang.in	15 Jan 2004 17:24:16 -0000	1.70
+++ ada/Make-lang.in	16 Jan 2004 18:49:04 -0000
@@ -1213,7 +1213,7 @@
    $(TREE_H) flags.h expr.h convert.h defaults.h ada/ada.h ada/types.h \
    ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h ada/einfo.h ada/namet.h \
    ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h gt-ada-utils.h \
-   gtype-ada.h
+   gtype-ada.h target.h
 
 ada/utils2.o : ada/utils2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TREE_H) flags.h ada/ada.h ada/types.h ada/atree.h ada/nlists.h \
Index: ada/utils.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/utils.c,v
retrieving revision 1.39
diff -u -r1.39 utils.c
--- ada/utils.c	24 Nov 2003 17:18:19 -0000	1.39
+++ ada/utils.c	16 Jan 2004 18:49:51 -0000
@@ -36,6 +36,7 @@
 #include "ggc.h"
 #include "debug.h"
 #include "convert.h"
+#include "target.h"
 
 #include "ada.h"
 #include "types.h"
@@ -1566,15 +1567,16 @@
 	break;
 
       case ATTR_LINK_SECTION:
-#ifdef ASM_OUTPUT_SECTION_NAME
-	DECL_SECTION_NAME (decl)
-	  = build_string (IDENTIFIER_LENGTH (attr_list->name),
-			  IDENTIFIER_POINTER (attr_list->name));
-	DECL_COMMON (decl) = 0;
-#else
-	post_error ("?section attributes are not supported for this target",
-		    attr_list->error_point);
-#endif
+	if (targetm.have_named_sections)
+	  {
+	    DECL_SECTION_NAME (decl)
+	      = build_string (IDENTIFIER_LENGTH (attr_list->name),
+			      IDENTIFIER_POINTER (attr_list->name));
+	    DECL_COMMON (decl) = 0;
+	  }
+	else
+	  post_error ("?section attributes are not supported for this target",
+		      attr_list->error_point);
 	break;
       }
 }
Index: config/alpha/unicosmk.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/unicosmk.h,v
retrieving revision 1.28
diff -u -r1.28 unicosmk.h
--- config/alpha/unicosmk.h	24 Dec 2003 00:14:19 -0000	1.28
+++ config/alpha/unicosmk.h	16 Jan 2004 18:49:51 -0000
@@ -460,11 +460,6 @@
          }						\
   } while(0)
 
-/*
-#define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC)	\
-  unicosmk_output_section_name ((STREAM), (DECL), (NAME), (RELOC))
-*/
-
 /* Switch into a generic section.  */
 #define TARGET_ASM_NAMED_SECTION unicosmk_asm_named_section
 
Index: config/stormy16/stormy16.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/stormy16/stormy16.h,v
retrieving revision 1.82
diff -u -r1.82 stormy16.h
--- config/stormy16/stormy16.h	15 Jan 2004 07:25:23 -0000	1.82
+++ config/stormy16/stormy16.h	16 Jan 2004 18:49:52 -0000
@@ -674,18 +674,6 @@
 #define ASM_APP_ON "#APP\n"
 
 #define ASM_APP_OFF "#NO_APP\n"
-
-/* A C statement to output something to the assembler file to switch to section
-   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.
-
-   At present this macro is only used to support section attributes.  When this
-   macro is undefined, section attributes are disabled.
-
-   Defined in svr4.h.  */
-/* #define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME) */
-
 
 /* Output of Data.  */
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]