]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
elf.h (TARGET_SECTION_TYPE_FLAGS): Define to xtensa_multibss_section_type_flags.
authorBob Wilson <bob.wilson@acm.org>
Wed, 4 Sep 2002 16:22:51 +0000 (16:22 +0000)
committerBob Wilson <bwilson@gcc.gnu.org>
Wed, 4 Sep 2002 16:22:51 +0000 (16:22 +0000)
        * config/xtensa/elf.h (TARGET_SECTION_TYPE_FLAGS): Define to
        xtensa_multibss_section_type_flags.
        * config/xtensa/xtensa.c (xtensa_multibss_section_type_flags): Define.

From-SVN: r56797

gcc/ChangeLog
gcc/config/xtensa/elf.h
gcc/config/xtensa/xtensa.c

index 00845ba374a88568ca24c7f758d8065d199b127e..dc248d883521d0cd266a8422314db2e1dc9596d3 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-04  Bob Wilson  <bob.wilson@acm.org>
+
+       * config/xtensa/elf.h (TARGET_SECTION_TYPE_FLAGS): Define to
+       xtensa_multibss_section_type_flags.
+       * config/xtensa/xtensa.c (xtensa_multibss_section_type_flags): Define.
+
 2002-09-04  Richard Henderson  <rth@redhat.com>
 
        * doc/install-old.texi: Don't mention enquire.
index 7d1ba00e6373861e54d8a6c130a006601ee77d71..866c463c8dd86c4eb800272785bfb157e2ea96e2 100644 (file)
@@ -24,6 +24,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
     builtin_define ("__ELF__");                                        \
   } while (0)
 
+#define TARGET_SECTION_TYPE_FLAGS xtensa_multibss_section_type_flags
+
 /* Don't assume anything about the header files. */
 #define NO_IMPLICIT_EXTERN_C
 
index 8bab197c6880a105457cc11007acafe41f5658fd..7b3ece1398f400a9175e1073b7f1979902cbaeec 100644 (file)
@@ -197,8 +197,10 @@ static rtx fixup_subreg_mem PARAMS ((rtx x));
 static enum machine_mode xtensa_find_mode_for_size PARAMS ((unsigned));
 static struct machine_function * xtensa_init_machine_status PARAMS ((void));
 static void printx PARAMS ((FILE *, signed int));
-static void xtensa_select_rtx_section PARAMS ((enum machine_mode, rtx,
-                                              unsigned HOST_WIDE_INT));
+static unsigned int xtensa_multibss_section_type_flags
+  PARAMS ((tree, const char *, int));
+static void xtensa_select_rtx_section
+  PARAMS ((enum machine_mode, rtx, unsigned HOST_WIDE_INT));
 static void xtensa_encode_section_info PARAMS ((tree, int));
 
 static rtx frame_size_const;
@@ -2746,6 +2748,34 @@ a7_overlap_mentioned_p (x)
   return 0;
 }
 
+
+/* Some Xtensa targets support multiple bss sections.  If the section
+   name ends with ".bss", add SECTION_BSS to the flags.  */
+
+static unsigned int
+xtensa_multibss_section_type_flags (decl, name, reloc)
+     tree decl;
+     const char *name;
+     int reloc;
+{
+  unsigned int flags = default_section_type_flags (decl, name, reloc);
+  const char *suffix;
+
+  suffix = strrchr (name, '.');
+  if (suffix && strcmp (suffix, ".bss") == 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 a "
+                ".bss section");
+    }
+
+  return flags;
+}
+
+
 /* The literal pool stays with the function.  */
 
 static void