Commit e893f6f3 by DJ Delorie Committed by DJ Delorie

varasm.c (default_function_rodata_section): Don't assume anything about where…

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
parent b246d100
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
......
......@@ -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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment