aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-05-14 08:37:09 +0000
committerNick Clifton <nickc@gcc.gnu.org>2015-05-14 08:37:09 +0000
commit12b3286d41a6aedba8e295a7c7934ec124904b55 (patch)
tree5aa97fa23158191e01f604a7b1429173c8d238ab /gcc
parent9f001ecfa8a201487d701a87fb7374bb54518769 (diff)
downloadgcc-12b3286d41a6aedba8e295a7c7934ec124904b55.zip
gcc-12b3286d41a6aedba8e295a7c7934ec124904b55.tar.gz
gcc-12b3286d41a6aedba8e295a7c7934ec124904b55.tar.bz2
rl78.c (rl78_select_section): Select the correct default section based upon the category of the decl.
* config/rl78/rl78.c (rl78_select_section): Select the correct default section based upon the category of the decl. From-SVN: r223192
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/rl78/rl78.c14
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0afa5b3..1b78ca3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-14 Nick Clifton <nickc@redhat.com>
+
+ * config/rl78/rl78.c (rl78_select_section): Select the correct
+ default section based upon the category of the decl.
+
2015-05-13 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/30967
diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c
index 0e4c227..6a15f91 100644
--- a/gcc/config/rl78/rl78.c
+++ b/gcc/config/rl78/rl78.c
@@ -4383,8 +4383,8 @@ rl78_asm_init_sections (void)
static section *
rl78_select_section (tree decl,
- int reloc ATTRIBUTE_UNUSED,
- unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
+ int reloc,
+ unsigned HOST_WIDE_INT align)
{
int readonly = 1;
@@ -4428,7 +4428,15 @@ rl78_select_section (tree decl,
if (readonly)
return readonly_data_section;
- return data_section;
+ switch (categorize_decl_for_section (decl, reloc))
+ {
+ case SECCAT_TEXT: return text_section;
+ case SECCAT_DATA: return data_section;
+ case SECCAT_BSS: return bss_section;
+ case SECCAT_RODATA: return readonly_data_section;
+ default:
+ return default_select_section (decl, reloc, align);
+ }
}
void