aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr/avr.c
diff options
context:
space:
mode:
authorDenis Chertykov <denisc@overta.ru>2000-06-07 16:45:46 +0000
committerDenis Chertykov <denisc@gcc.gnu.org>2000-06-07 20:45:46 +0400
commit3f8a8c683b0930176c3d10c36df48041f9fec96e (patch)
tree90441b54ed11bbd1ff94657d9b76c080e5757ae1 /gcc/config/avr/avr.c
parent7bf81eeefc61820c53f1ce886ed23905e5aab9f5 (diff)
downloadgcc-3f8a8c683b0930176c3d10c36df48041f9fec96e.zip
gcc-3f8a8c683b0930176c3d10c36df48041f9fec96e.tar.gz
gcc-3f8a8c683b0930176c3d10c36df48041f9fec96e.tar.bz2
avr.c (asm_output_section_name): output section attributes.
* config/avr/avr.c (asm_output_section_name): output section attributes. * config/avr/libgcc.S (.text.libgcc): declare section attributes. From-SVN: r34445
Diffstat (limited to 'gcc/config/avr/avr.c')
-rw-r--r--gcc/config/avr/avr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index fbb96cf..dda7190 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -3206,16 +3206,20 @@ unique_section (decl, reloc)
}
-/* Output section name to file FILE */
+/* Output section name to file FILE
+ 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. */
void
asm_output_section_name(file, decl, name, reloc)
FILE *file;
- tree decl ATTRIBUTE_UNUSED;
+ tree decl;
const char *name;
int reloc ATTRIBUTE_UNUSED;
{
- fprintf (file, ".section %s\n", name);
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", name, \
+ decl && TREE_CODE (decl) == FUNCTION_DECL ? "ax" :
+ decl && TREE_READONLY (decl) ? "a" : "aw");
}