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
This commit is contained in:
Paolo Bonzini 2007-08-29 17:01:35 +00:00 committed by David Edelsohn
parent c9be035185
commit 21d9bb3f56
2 changed files with 23 additions and 4 deletions

View 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.

View 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;