From 3f8a8c683b0930176c3d10c36df48041f9fec96e Mon Sep 17 00:00:00 2001 From: Denis Chertykov Date: Wed, 7 Jun 2000 16:45:46 +0000 Subject: 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 --- gcc/ChangeLog | 6 ++++++ gcc/config/avr/avr.c | 10 +++++++--- gcc/config/avr/libgcc.S | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f8e558..7906c8d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Wed Jun 7 20:34:33 2000 Denis Chertykov + + * config/avr/avr.c (asm_output_section_name): output section + attributes. + * config/avr/libgcc.S (.text.libgcc): declare section attributes. + 2000-06-06 James E. Wilson * frame.h (struct unwind_info_ptr): Collapse version, flags, and length 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"); } diff --git a/gcc/config/avr/libgcc.S b/gcc/config/avr/libgcc.S index ffaf6cf..10fa12e 100644 --- a/gcc/config/avr/libgcc.S +++ b/gcc/config/avr/libgcc.S @@ -32,7 +32,7 @@ Boston, MA 02111-1307, USA. */ #define __SP_H__ 0x3e #define __SP_L__ 0x3d - .section .text.libgcc + .section .text.libgcc, "ax", @progbits /******************************************************* Multiplication 8 x 8 -- cgit v1.1