diff options
author | Roland McGrath <roland@gcc.gnu.org> | 1995-04-14 23:31:05 +0000 |
---|---|---|
committer | Roland McGrath <roland@gcc.gnu.org> | 1995-04-14 23:31:05 +0000 |
commit | fa42ea0227fb2915d639c83c0adf770225081377 (patch) | |
tree | 82a294e07884ae412a776e2e3c52cc3ac8ecc76c | |
parent | ea8e4ec574c6e77c5efa450e34494872e3c93f8f (diff) | |
download | gcc-fa42ea0227fb2915d639c83c0adf770225081377.zip gcc-fa42ea0227fb2915d639c83c0adf770225081377.tar.gz gcc-fa42ea0227fb2915d639c83c0adf770225081377.tar.bz2 |
(ASM_OUTPUT_SECTION_NAME): Make the section read-only executable "ax" if DECL is a FUNCTION_DECL...
(ASM_OUTPUT_SECTION_NAME): Make the section read-only executable "ax"
if DECL is a FUNCTION_DECL; read-only "a" (previously the case always)
if DECL is TREE_READONLY; otherwise writable "aw".
From-SVN: r9386
-rw-r--r-- | gcc/config/svr4.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/config/svr4.h b/gcc/config/svr4.h index 8803dd4..051187b 100644 --- a/gcc/config/svr4.h +++ b/gcc/config/svr4.h @@ -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. */ |