From c16e5a3596f133f3812119d7d0ddfae30b117140 Mon Sep 17 00:00:00 2001 From: Marek Michalkiewicz Date: Sat, 8 Jun 2002 22:38:15 +0200 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/config/avr/avr.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 34c62e38b77..0abf2434ef3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-06-08 Marek Michalkiewicz + + * config/avr/avr.c (TARGET_SECTION_TYPE_FLAGS): New. + (avr_section_type_flags): New, handle .noinit* sections. + 2002-06-08 Jason Thorpe * config/sh/netbsd-elf.h (SUBTARGET_EXTRA_SPECS): Define diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 41dcfbc74bb..56900ae7330 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. */ -- 2.30.2