OSDN Git Service

(ASM_OUTPUT_SECTION_NAME): Make the section read-only executable "ax"
authorroland <roland@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Apr 1995 23:31:05 +0000 (23:31 +0000)
committerroland <roland@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Apr 1995 23:31:05 +0000 (23:31 +0000)
if DECL is a FUNCTION_DECL; read-only "a" (previously the case always)
if DECL is TREE_READONLY; otherwise writable "aw".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9386 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/svr4.h

index 8803dd4..051187b 100644 (file)
@@ -572,10 +572,15 @@ dtors_section ()                                                  \
 }
 
 /* Switch into a generic section.
-   This is currently only used to support section attributes.  */
+   This is currently only used to support section attributes.
 
+   We make the section read-only and executable for a function decl,
+   read-only for a const data decl, and writable for a non-const data decl.  */
 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
-  fprintf (FILE, ".section\t%s,\"a\",@progbits\n", NAME)
+  fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+          TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+          TREE_READONLY (DECL) ? "a" : "aw")
+
 
 /* A C statement (sans semicolon) to output an element in the table of
    global constructors.  */