m3-sys/m3cc/gcc-apple/gcc/varasm.c
/* Return the read-only data section associated with function DECL.  */
Return the read-only data section associated with function DECL.
Return the read - only data section associated with function DECL .
section *
default_function_rodata_section (tree decl)
{
  if (decl != NULL_TREE && DECL_SECTION_NAME (decl))
    {
      const char *name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
      if (DECL_ONE_ONLY (decl) && HAVE_COMDAT_GROUP)
        {
	  size_t len = strlen (name) + 3;
	  char* rname = alloca (len);
	  strcpy (rname, ".rodata");
	  strcat (rname, name + 5);
	  return get_section (rname, SECTION_LINKONCE, decl);
	}
      else if (DECL_ONE_ONLY (decl)
	       && strncmp (name, ".gnu.linkonce.t.", 16) == 0)
	{
	  size_t len = strlen (name) + 1;
	  char *rname = alloca (len);
	  memcpy (rname, name, len);
	  rname[14] = 'r';
	  return get_section (rname, SECTION_LINKONCE, decl);
	}
      else if (flag_function_sections && flag_data_sections
	       && strncmp (name, ".text.", 6) == 0)
	{
	  size_t len = strlen (name) + 1;
	  char *rname = alloca (len + 2);
	  memcpy (rname, ".rodata", 7);
	  memcpy (rname + 7, name + 5, len - 5);
	  return get_section (rname, 0, decl);
	}
    }
  return readonly_data_section;
}
section * default_function_rodata_section ( tree decl ) { if ( decl != NULL_TREE && DECL_SECTION_NAME ( decl ) ) { const char * name = TREE_STRING_POINTER ( DECL_SECTION_NAME ( decl ) ) ; if ( DECL_ONE_ONLY ( decl ) && HAVE_COMDAT_GROUP ) { size_t len = strlen ( name ) + 3 ; char * rname = alloca ( len ) ; strcpy ( rname , " " ) ; strcat ( rname , name + 5 ) ; return get_section ( rname , SECTION_LINKONCE , decl ) ; } else if ( DECL_ONE_ONLY ( decl ) && strncmp ( name , " " , 16 ) == 0 ) { size_t len = strlen ( name ) + 1 ; char * rname = alloca ( len ) ; memcpy ( rname , name , len ) ; rname [ 14 ] = ' ' ; return get_section ( rname , SECTION_LINKONCE , decl ) ; } else if ( flag_function_sections && flag_data_sections && strncmp ( name , " " , 6 ) == 0 ) { size_t len = strlen ( name ) + 1 ; char * rname = alloca ( len + 2 ) ; memcpy ( rname , " " , 7 ) ; memcpy ( rname + 7 , name + 5 , len - 5 ) ; return get_section ( rname , 0 , decl ) ; } } return readonly_data_section ; }
Return the read-only data section associated with function DECL.
Return the read - only data section associated with function DECL .
/* For .gnu.linkonce.t.foo we want to use .gnu.linkonce.r.foo.  */ /* For .text.foo we want to use .rodata.foo.  */