diff options
author | Bob Wilson <bob.wilson@acm.org> | 2002-09-04 16:22:51 +0000 |
---|---|---|
committer | Bob Wilson <bwilson@gcc.gnu.org> | 2002-09-04 16:22:51 +0000 |
commit | 01abf342f82f9db810b16e139fd15986afc75168 (patch) | |
tree | c1421f79baacb61a40a46c6629d7c574038fec70 /gcc | |
parent | cd42d3df16374d1efef9ca9490122c0ef9ed20fd (diff) | |
download | gcc-01abf342f82f9db810b16e139fd15986afc75168.zip gcc-01abf342f82f9db810b16e139fd15986afc75168.tar.gz gcc-01abf342f82f9db810b16e139fd15986afc75168.tar.bz2 |
elf.h (TARGET_SECTION_TYPE_FLAGS): Define to xtensa_multibss_section_type_flags.
* 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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/xtensa/elf.h | 2 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa.c | 34 |
3 files changed, 40 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 00845ba..dc248d8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h index 7d1ba00..866c463 100644 --- a/gcc/config/xtensa/elf.h +++ b/gcc/config/xtensa/elf.h @@ -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 diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 8bab197..7b3ece1 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -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 |