summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authormarekm <marekm@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-08 20:38:15 +0000
committermarekm <marekm@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-08 20:38:15 +0000
commit8a46ca3870faa9d172213439eb61a0fc3a45329d (patch)
treeffb9828bec7ee25fb84abb81451874b878998995 /gcc
parenta7dbd1a4a143822ede027f5d9fefe0b2669fe903 (diff)
downloadgcc-8a46ca3870faa9d172213439eb61a0fc3a45329d.tar.gz
* config/avr/avr.c (TARGET_SECTION_TYPE_FLAGS): New.
(avr_section_type_flags): New, handle .noinit* sections. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54389 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/avr/avr.c24
2 files changed, 29 insertions, 0 deletions
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 <marekm@amelek.gda.pl>
+
+ * config/avr/avr.c (TARGET_SECTION_TYPE_FLAGS): New.
+ (avr_section_type_flags): New, handle .noinit* sections.
+
2002-06-08 Jason Thorpe <thorpej@wasabisystems.com>
* 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. */