diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2007-08-29 17:01:35 +0000 |
---|---|---|
committer | David Edelsohn <dje@gcc.gnu.org> | 2007-08-29 13:01:35 -0400 |
commit | 21d9bb3f56adf9e034af6ad1a53a57a560c4de2d (patch) | |
tree | d9624bc102de5a589e0c4e47d72203b6e5cce146 | |
parent | c9be03518508fce505dba0cc5ea8100218a740af (diff) | |
download | gcc-21d9bb3f56adf9e034af6ad1a53a57a560c4de2d.zip gcc-21d9bb3f56adf9e034af6ad1a53a57a560c4de2d.tar.gz gcc-21d9bb3f56adf9e034af6ad1a53a57a560c4de2d.tar.bz2 |
re PR target/33168 (GCC Boot failure, building libstc++)
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.
From-SVN: r127910
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 20 |
2 files changed, 23 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aee97d8..9bfa84d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index dbf7e78..38659bf 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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; |