varasm.c (default_function_rodata_section): Don't assume anything about where the first '.' in the section name is.

* varasm.c (default_function_rodata_section): Don't assume
anything about where the first '.' in the section name is.

From-SVN: r145388
This commit is contained in:
DJ Delorie 2009-04-01 01:26:39 -04:00 committed by DJ Delorie
parent b246d10043
commit e893f6f38e
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2009-04-01 DJ Delorie <dj@redhat.com>
* varasm.c (default_function_rodata_section): Don't assume
anything about where the first '.' in the section name is.
2009-04-01 Alan Modra <amodra@bigpond.net.au>
* config/rs6000/rs6000.c (rs6000_emit_stack_reset): Delete redundant

View File

@ -869,11 +869,18 @@ default_function_rodata_section (tree decl)
if (DECL_ONE_ONLY (decl) && HAVE_COMDAT_GROUP)
{
size_t len = strlen (name) + 3;
char* rname = (char *) alloca (len);
char *dot;
size_t len;
char* rname;
dot = strchr (name + 1, '.');
if (!dot)
dot = name;
len = strlen (dot) + 8;
rname = (char *) alloca (len);
strcpy (rname, ".rodata");
strcat (rname, name + 5);
strcat (rname, dot);
return get_section (rname, SECTION_LINKONCE, decl);
}
/* For .gnu.linkonce.t.foo we want to use .gnu.linkonce.r.foo. */