FreeBSD/contrib/gcc/varasm.c
/* Select a section based on the above categorization.  */
Select a section based on the above categorization.
Select a section based on the above categorization .
section *
default_elf_select_section (tree decl, int reloc,
			    unsigned HOST_WIDE_INT align)
{
  const char *sname;
  switch (categorize_decl_for_section (decl, reloc))
    {
    case SECCAT_TEXT:
      gcc_unreachable ();
    case SECCAT_RODATA:
      return readonly_data_section;
    case SECCAT_RODATA_MERGE_STR:
      return mergeable_string_section (decl, align, 0);
    case SECCAT_RODATA_MERGE_STR_INIT:
      return mergeable_string_section (DECL_INITIAL (decl), align, 0);
    case SECCAT_RODATA_MERGE_CONST:
      return mergeable_constant_section (DECL_MODE (decl), align, 0);
    case SECCAT_SRODATA:
      sname = ".sdata2";
      break;
    case SECCAT_DATA:
      return data_section;
    case SECCAT_DATA_REL:
      sname = ".data.rel";
      break;
    case SECCAT_DATA_REL_LOCAL:
      sname = ".data.rel.local";
      break;
    case SECCAT_DATA_REL_RO:
      sname = ".data.rel.ro";
      break;
    case SECCAT_DATA_REL_RO_LOCAL:
      sname = ".data.rel.ro.local";
      break;
    case SECCAT_SDATA:
      sname = ".sdata";
      break;
    case SECCAT_TDATA:
      sname = ".tdata";
      break;
    case SECCAT_BSS:
      if (bss_section)
	return bss_section;
      sname = ".bss";
      break;
    case SECCAT_SBSS:
      sname = ".sbss";
      break;
    case SECCAT_TBSS:
      sname = ".tbss";
      break;
    default:
      gcc_unreachable ();
    }
  if (!DECL_P (decl))
    decl = NULL_TREE;
  return get_named_section (decl, sname, reloc);
}
section * default_elf_select_section ( tree decl , int reloc , unsigned HOST_WIDE_INT align ) { const char * sname ; switch ( categorize_decl_for_section ( decl , reloc ) ) { case SECCAT_TEXT : gcc_unreachable ( ) ; case SECCAT_RODATA : return readonly_data_section ; case SECCAT_RODATA_MERGE_STR : return mergeable_string_section ( decl , align , 0 ) ; case SECCAT_RODATA_MERGE_STR_INIT : return mergeable_string_section ( DECL_INITIAL ( decl ) , align , 0 ) ; case SECCAT_RODATA_MERGE_CONST : return mergeable_constant_section ( DECL_MODE ( decl ) , align , 0 ) ; case SECCAT_SRODATA : sname = " " ; break ; case SECCAT_DATA : return data_section ; case SECCAT_DATA_REL : sname = " " ; break ; case SECCAT_DATA_REL_LOCAL : sname = " " ; break ; case SECCAT_DATA_REL_RO : sname = " " ; break ; case SECCAT_DATA_REL_RO_LOCAL : sname = " " ; break ; case SECCAT_SDATA : sname = " " ; break ; case SECCAT_TDATA : sname = " " ; break ; case SECCAT_BSS : if ( bss_section ) return bss_section ; sname = " " ; break ; case SECCAT_SBSS : sname = " " ; break ; case SECCAT_TBSS : sname = " " ; break ; default : gcc_unreachable ( ) ; } if ( ! DECL_P ( decl ) ) decl = NULL_TREE ; return get_named_section ( decl , sname , reloc ) ; }
Select a section based on the above categorization.
Select a section based on the above categorization .
/* We're not supposed to be called on FUNCTION_DECLs.  */