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]

Patch: SECTION_OVERRIDE



This patch was suggested by Jakub and is needed for a follow on patch
to merge gcj's UTF-8 constants at link time.

Tested on i686-pc-linux-gnu.  Ok?


2001-09-13  Anthony Green  <green@redhat.com>

	* output.h (SECTION_OVERRIDE): Define.
	* varasm.c (named_section): Obey SECTION_OVERRIDE.

Index: gcc/output.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/output.h,v
retrieving revision 1.79
diff -u -p -r1.79 output.h
--- output.h	2001/09/11 16:49:55	1.79
+++ output.h	2001/09/13 18:44:27
@@ -471,6 +471,7 @@ extern void no_asm_to_stream PARAMS ((FI
 #define SECTION_STRINGS  0x10000	/* contains zero terminated strings without
 					   embedded zeros */
 #define SECTION_MACH_DEP 0x20000	/* subsequent bits reserved for target */
+#define SECTION_OVERRIDE 0x40000	/* override default property flags */
 
 extern unsigned int get_named_section_flags PARAMS ((const char *));
 extern bool set_named_section_flags	PARAMS ((const char *, unsigned int));
Index: gcc/varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.206
diff -u -p -r1.206 varasm.c
--- varasm.c	2001/09/12 17:17:52	1.206
+++ varasm.c	2001/09/13 18:44:28
@@ -412,11 +412,14 @@ named_section (decl, name, reloc)
 
   flags = (* targetm.section_type_flags) (decl, name, reloc);
 
-  /* Sanity check user variables for flag changes.  Non-user
-     section flag changes will abort in named_section_flags.  */
+  /* Sanity check user variables for flag changes.  Non-user section
+     flag changes will abort in named_section_flags.  However, don't
+     complain if SECTION_OVERRIDE is set.  We trust that the setter
+     knows that it is safe to ignore the default flags for this decl.  */
   if (decl && ! set_named_section_flags (name, flags))
     {
-      error_with_decl (decl, "%s causes a section type conflict");
+      if ((flags & SECTION_OVERRIDE) == 0)
+	error_with_decl (decl, "%s causes a section type conflict");
       flags = get_named_section_flags (name);
     }
 


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