OSDN Git Service

2007-08-29 Paolo Bonzini <bonzini@gnu.org>
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Aug 2007 17:01:35 +0000 (17:01 +0000)
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Aug 2007 17:01:35 +0000 (17:01 +0000)
        PR target/33168
        * config/rs6000/rs6000.c (compare_section_name): New function.
        (rs6000_elf_in_small_data_p): Compare section prefixes instead
        of full name.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127910 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index aee97d8..9bfa84d 100644 (file)
@@ -1,3 +1,10 @@
+2007-08-29  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR target/33168
+       * config/rs6000/rs6000.c (compare_section_name): New function.
+       (rs6000_elf_in_small_data_p): Compare section prefixes instead
+       of full name.
+
 2007-08-29  Olivier Hainque  <hainque@adacore.com>
 
        * xcoffout.c: #include debug.h.
index dbf7e78..38659bf 100644 (file)
@@ -19234,6 +19234,16 @@ rs6000_elf_encode_section_info (tree decl, rtx rtl, int first)
     }
 }
 
+static inline bool
+compare_section_name (const char *section, const char *template)
+{
+  int len;
+
+  len = strlen (template);
+  return (strncmp (section, template, len) == 0
+         && (section[len] == 0 || section[len] == '.'));
+}
+
 bool
 rs6000_elf_in_small_data_p (const_tree decl)
 {
@@ -19251,10 +19261,12 @@ rs6000_elf_in_small_data_p (const_tree decl)
   if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl))
     {
       const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
-      if (strcmp (section, ".sdata") == 0
-         || strcmp (section, ".sdata2") == 0
-         || strcmp (section, ".sbss") == 0
-         || strcmp (section, ".sbss2") == 0
+      if (compare_section_name (section, ".sdata") == 0
+         || compare_section_name (section, ".sdata2") == 0
+         || compare_section_name (section, ".gnu.linkonce.s") == 0
+         || compare_section_name (section, ".sbss") == 0
+         || compare_section_name (section, ".sbss2") == 0
+         || compare_section_name (section, ".gnu.linkonce.sb") == 0
          || strcmp (section, ".PPC.EMB.sdata0") == 0
          || strcmp (section, ".PPC.EMB.sbss0") == 0)
        return true;