From bdc1084483a172f5ea24ac4a90642d6afce00604 Mon Sep 17 00:00:00 2001 From: jonathan Date: Fri, 8 Nov 1996 22:21:52 +0000 Subject: [PATCH] Commit years-old change for gcc on NetDSB/mips. The NetbSD libc header files use GCC attributes to emit link-time warning messages (e.g,. for gets()). SO, add a definition of the GCC back-end macro ASM_OUTPUT_SECTION_NAME() to the mips back-end target-specific file. This adds support for emitting warning attributes to binutils 2.6 or newer. (Weak references may or may not work also). This patch has been submitted to the FSF but hasn't made it into 2.7.2.1, and seems to have got buried somewhere inside Cygnus. --- gnu/usr.bin/gcc/arch/mips/mips.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gnu/usr.bin/gcc/arch/mips/mips.h b/gnu/usr.bin/gcc/arch/mips/mips.h index cc1c8c84936a..0e03ee4f2873 100644 --- a/gnu/usr.bin/gcc/arch/mips/mips.h +++ b/gnu/usr.bin/gcc/arch/mips/mips.h @@ -3811,3 +3811,19 @@ while (0) #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)