Subject: mips gcc attribute patch [ gcc stuff: __warn_references doesn't work ]
To: Simon Burge <simonb@telstra.com.au>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 06/25/1996 21:48:39
>From: Simon Burge <simonb@telstra.com.au>
Subject: gcc stuff: __warn_references doesn't work
Date: Wed, 26 Jun 1996 14:25:40 +1000

>I've tried tried to do a "make build", and didn't get very far before
>gcc warned me that "section attributes are not supported for this
>target".

Every year, this  same thing keeps happening. :)

One needs to apply the following to src/gnu/usr.bin/gcc/arch/mips/mips.h....

I thought I'd sent it into the maintainer of the patchfile,
but it keeps getting lost...



*** mips.h.DIST	Mon Dec 11 12:14:19 1995
--- mips.h.dsg.SAVE	Thu Dec 14 14:39:21 1995
***************
*** 3811,3813 ****
--- 3811,3829 ----
  #define NO_BUILTIN_PTRDIFF_TYPE
  #define PTRDIFF_TYPE (TARGET_LONG64 ? "long int" : "int")
  #endif
+ 
+ /* 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.  */
+ 
+ #define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME) \
+ do {								\
+   extern FILE *asm_out_text_file;				\
+   if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL)		\
+     fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
+   else if ((DECL) && TREE_READONLY (DECL))			\
+     fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME));	\
+   else								\
+     fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME));	\
+ } while (0)