aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/avr')
-rw-r--r--gcc/config/avr/avr-protos.h2
-rw-r--r--gcc/config/avr/avr.c6
-rw-r--r--gcc/config/avr/avr.h2
3 files changed, 6 insertions, 4 deletions
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index e47b7e0..966a0cb 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -44,7 +44,7 @@ extern void gas_output_ascii PARAMS ((FILE *file, const char *str,
extern void asm_output_external PARAMS ((FILE *file, tree decl,
char *name));
extern void unique_section PARAMS ((tree decl, int reloc));
-extern void encode_section_info PARAMS ((tree decl));
+extern void encode_section_info PARAMS ((tree decl, int));
extern int avr_progmem_p PARAMS ((tree decl));
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 8e64bcb..30ea833 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -4741,12 +4741,14 @@ avr_progmem_p (decl)
/* Encode section information about tree DECL */
void
-encode_section_info (decl)
+encode_section_info (decl, first)
tree decl;
+ int first;
{
if (TREE_CODE (decl) == FUNCTION_DECL)
SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
- else if ((TREE_STATIC (decl) || DECL_EXTERNAL (decl))
+ else if (first
+ && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
&& TREE_CODE (decl) == VAR_DECL
&& avr_progmem_p (decl))
{
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index ffcfa26..9b5b35f 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -1830,7 +1830,7 @@ progmem_section (void) \
This macro is irrelevant if there is no separate readonly data
section. */
-#define ENCODE_SECTION_INFO(DECL) encode_section_info(DECL)
+#define ENCODE_SECTION_INFO(DECL, FIRST) encode_section_info(DECL, FIRST)
/* Define this macro if references to a symbol must be treated
differently depending on something about the variable or function
named by the symbol (such as what section it is in).