rl78.c (rl78_select_section): Select the correct default section based upon the categ...
authorNick Clifton <nickc@redhat.com>
Thu, 14 May 2015 08:37:09 +0000 (08:37 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Thu, 14 May 2015 08:37:09 +0000 (08:37 +0000)
* config/rl78/rl78.c (rl78_select_section): Select the correct
default section based upon the category of the decl.

From-SVN: r223192

gcc/ChangeLog
gcc/config/rl78/rl78.c

index 0afa5b3b98540cbb2d760a2a1e73dd31b1f9c76a..1b78ca32e5fbf9126b379cf1ea6295fbcf72161f 100644 (file)
@@ -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
index 0e4c22789743b04db9b5859563a444a0faae250f..6a15f915c915ffac752a46d1d1e98d558672bd43 100644 (file)
@@ -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