m3-sys/m3cc/gcc-apple/gcc/varasm.c
/* Construct a unique section name based on the decl name and the
   categorization performed above.  */
Construct a unique section name based on the decl name and the
categorization performed above.
Construct a unique section name based on the decl name and the categorization performed above .
void
default_unique_section (tree decl, int reloc)
{
  bool one_only = DECL_ONE_ONLY (decl) && !HAVE_COMDAT_GROUP;
  const char *prefix, *name;
  size_t nlen, plen;
  char *string;
  switch (categorize_decl_for_section (decl, reloc))
    {
    case SECCAT_TEXT:
      prefix = one_only ? ".gnu.linkonce.t." : ".text.";
      break;
    case SECCAT_RODATA:
    case SECCAT_RODATA_MERGE_STR:
    case SECCAT_RODATA_MERGE_STR_INIT:
    case SECCAT_RODATA_MERGE_CONST:
      prefix = one_only ? ".gnu.linkonce.r." : ".rodata.";
      break;
    case SECCAT_SRODATA:
      prefix = one_only ? ".gnu.linkonce.s2." : ".sdata2.";
      break;
    case SECCAT_DATA:
      prefix = one_only ? ".gnu.linkonce.d." : ".data.";
      break;
    case SECCAT_DATA_REL:
      prefix = one_only ? ".gnu.linkonce.d.rel." : ".data.rel.";
      break;
    case SECCAT_DATA_REL_LOCAL:
      prefix = one_only ? ".gnu.linkonce.d.rel.local." : ".data.rel.local.";
      break;
    case SECCAT_DATA_REL_RO:
      prefix = one_only ? ".gnu.linkonce.d.rel.ro." : ".data.rel.ro.";
      break;
    case SECCAT_DATA_REL_RO_LOCAL:
      prefix = one_only ? ".gnu.linkonce.d.rel.ro.local."
	       : ".data.rel.ro.local.";
      break;
    case SECCAT_SDATA:
      prefix = one_only ? ".gnu.linkonce.s." : ".sdata.";
      break;
    case SECCAT_BSS:
      prefix = one_only ? ".gnu.linkonce.b." : ".bss.";
      break;
    case SECCAT_SBSS:
      prefix = one_only ? ".gnu.linkonce.sb." : ".sbss.";
      break;
    case SECCAT_TDATA:
      prefix = one_only ? ".gnu.linkonce.td." : ".tdata.";
      break;
    case SECCAT_TBSS:
      prefix = one_only ? ".gnu.linkonce.tb." : ".tbss.";
      break;
    default:
      gcc_unreachable ();
    }
  plen = strlen (prefix);
  name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
  name = targetm.strip_name_encoding (name);
  nlen = strlen (name);
  string = alloca (nlen + plen + 1);
  memcpy (string, prefix, plen);
  memcpy (string + plen, name, nlen + 1);
  DECL_SECTION_NAME (decl) = build_string (nlen + plen, string);
}
void default_unique_section ( tree decl , int reloc ) { bool one_only = DECL_ONE_ONLY ( decl ) && ! HAVE_COMDAT_GROUP ; const char * prefix , * name ; size_t nlen , plen ; char * string ; switch ( categorize_decl_for_section ( decl , reloc ) ) { case SECCAT_TEXT : prefix = one_only ? " " : " " ; break ; case SECCAT_RODATA : case SECCAT_RODATA_MERGE_STR : case SECCAT_RODATA_MERGE_STR_INIT : case SECCAT_RODATA_MERGE_CONST : prefix = one_only ? " " : " " ; break ; case SECCAT_SRODATA : prefix = one_only ? " " : " " ; break ; case SECCAT_DATA : prefix = one_only ? " " : " " ; break ; case SECCAT_DATA_REL : prefix = one_only ? " " : " " ; break ; case SECCAT_DATA_REL_LOCAL : prefix = one_only ? " " : " " ; break ; case SECCAT_DATA_REL_RO : prefix = one_only ? " " : " " ; break ; case SECCAT_DATA_REL_RO_LOCAL : prefix = one_only ? " " : " " ; break ; case SECCAT_SDATA : prefix = one_only ? " " : " " ; break ; case SECCAT_BSS : prefix = one_only ? " " : " " ; break ; case SECCAT_SBSS : prefix = one_only ? " " : " " ; break ; case SECCAT_TDATA : prefix = one_only ? " " : " " ; break ; case SECCAT_TBSS : prefix = one_only ? " " : " " ; break ; default : gcc_unreachable ( ) ; } plen = strlen ( prefix ) ; name = IDENTIFIER_POINTER ( DECL_ASSEMBLER_NAME ( decl ) ) ; name = targetm . strip_name_encoding ( name ) ; nlen = strlen ( name ) ; string = alloca ( nlen + plen + 1 ) ; memcpy ( string , prefix , plen ) ; memcpy ( string + plen , name , nlen + 1 ) ; DECL_SECTION_NAME ( decl ) = build_string ( nlen + plen , string ) ; }
Construct a unique section name based on the decl name and the
categorization performed above.
Construct a unique section name based on the decl name and the categorization performed above .
/* We only need to use .gnu.linkonce if we don't have COMDAT groups.  */