diff options
author | Marek Michalkiewicz <marekm@amelek.gda.pl> | 2002-06-08 22:38:15 +0200 |
---|---|---|
committer | Marek Michalkiewicz <marekm@gcc.gnu.org> | 2002-06-08 20:38:15 +0000 |
commit | c16e5a3596f133f3812119d7d0ddfae30b117140 (patch) | |
tree | ffb9828bec7ee25fb84abb81451874b878998995 /gcc/config/avr | |
parent | 79bc889e3ac1527e994d809f9b1bf00abcb1857c (diff) | |
download | gcc-c16e5a3596f133f3812119d7d0ddfae30b117140.zip gcc-c16e5a3596f133f3812119d7d0ddfae30b117140.tar.gz gcc-c16e5a3596f133f3812119d7d0ddfae30b117140.tar.bz2 |
avr.c (TARGET_SECTION_TYPE_FLAGS): New.
* config/avr/avr.c (TARGET_SECTION_TYPE_FLAGS): New.
(avr_section_type_flags): New, handle .noinit* sections.
From-SVN: r54389
Diffstat (limited to 'gcc/config/avr')
-rw-r--r-- | gcc/config/avr/avr.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 41dcfbc..56900ae 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -66,6 +66,7 @@ static void avr_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); static void avr_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); static void avr_unique_section PARAMS ((tree, int)); static void avr_encode_section_info PARAMS ((tree, int)); +static unsigned int avr_section_type_flags PARAMS ((tree, const char *, int)); static void avr_asm_out_ctor PARAMS ((rtx, int)); static void avr_asm_out_dtor PARAMS ((rtx, int)); @@ -220,6 +221,8 @@ int avr_case_values_threshold = 30000; #define TARGET_ASM_UNIQUE_SECTION avr_unique_section #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO avr_encode_section_info +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS avr_section_type_flags struct gcc_target targetm = TARGET_INITIALIZER; @@ -4830,6 +4833,27 @@ avr_encode_section_info (decl, first) } } +static unsigned int +avr_section_type_flags (decl, name, reloc) + tree decl; + const char *name; + int reloc; +{ + unsigned int flags = default_section_type_flags (decl, name, reloc); + + if (strncmp (name, ".noinit", 7) == 0) + { + if (decl && TREE_CODE (decl) == VAR_DECL + && DECL_INITIAL (decl) == NULL_TREE) + flags |= SECTION_BSS; /* @nobits */ + else + warning ("only uninitialized variables can be placed in the " + ".noinit section"); + } + + return flags; +} + /* Outputs to the stdio stream FILE some appropriate text to go at the start of an assembler file. */ |