Commit e13971e0 by Alan Modra Committed by Alan Modra

varasm.c (default_elf_select_section_1): Only pass DECL_P decl to named_section.

	* varasm.c (default_elf_select_section_1): Only pass DECL_P decl
	to named_section.

From-SVN: r91464
parent d41ca8e6
2004-11-29 Alan Modra <amodra@bigpond.net.au>
* varasm.c (default_elf_select_section_1): Only pass DECL_P decl
to named_section.
2004-11-29 Nathan Sidwell <nathan@codesourcery.com> 2004-11-29 Nathan Sidwell <nathan@codesourcery.com>
* opts.c (decode_options): Do not set max-inline-insns-rtl. * opts.c (decode_options): Do not set max-inline-insns-rtl.
......
...@@ -4897,6 +4897,7 @@ void ...@@ -4897,6 +4897,7 @@ void
default_elf_select_section_1 (tree decl, int reloc, default_elf_select_section_1 (tree decl, int reloc,
unsigned HOST_WIDE_INT align, int shlib) unsigned HOST_WIDE_INT align, int shlib)
{ {
const char *sname;
switch (categorize_decl_for_section (decl, reloc, shlib)) switch (categorize_decl_for_section (decl, reloc, shlib))
{ {
case SECCAT_TEXT: case SECCAT_TEXT:
...@@ -4904,56 +4905,61 @@ default_elf_select_section_1 (tree decl, int reloc, ...@@ -4904,56 +4905,61 @@ default_elf_select_section_1 (tree decl, int reloc,
abort (); abort ();
case SECCAT_RODATA: case SECCAT_RODATA:
readonly_data_section (); readonly_data_section ();
break; return;
case SECCAT_RODATA_MERGE_STR: case SECCAT_RODATA_MERGE_STR:
mergeable_string_section (decl, align, 0); mergeable_string_section (decl, align, 0);
break; return;
case SECCAT_RODATA_MERGE_STR_INIT: case SECCAT_RODATA_MERGE_STR_INIT:
mergeable_string_section (DECL_INITIAL (decl), align, 0); mergeable_string_section (DECL_INITIAL (decl), align, 0);
break; return;
case SECCAT_RODATA_MERGE_CONST: case SECCAT_RODATA_MERGE_CONST:
mergeable_constant_section (DECL_MODE (decl), align, 0); mergeable_constant_section (DECL_MODE (decl), align, 0);
break; return;
case SECCAT_SRODATA: case SECCAT_SRODATA:
named_section (decl, ".sdata2", reloc); sname = ".sdata2";
break; break;
case SECCAT_DATA: case SECCAT_DATA:
data_section (); data_section ();
break; return;
case SECCAT_DATA_REL: case SECCAT_DATA_REL:
named_section (decl, ".data.rel", reloc); sname = ".data.rel";
break; break;
case SECCAT_DATA_REL_LOCAL: case SECCAT_DATA_REL_LOCAL:
named_section (decl, ".data.rel.local", reloc); sname = ".data.rel.local";
break; break;
case SECCAT_DATA_REL_RO: case SECCAT_DATA_REL_RO:
named_section (decl, ".data.rel.ro", reloc); sname = ".data.rel.ro";
break; break;
case SECCAT_DATA_REL_RO_LOCAL: case SECCAT_DATA_REL_RO_LOCAL:
named_section (decl, ".data.rel.ro.local", reloc); sname = ".data.rel.ro.local";
break; break;
case SECCAT_SDATA: case SECCAT_SDATA:
named_section (decl, ".sdata", reloc); sname = ".sdata";
break; break;
case SECCAT_TDATA: case SECCAT_TDATA:
named_section (decl, ".tdata", reloc); sname = ".tdata";
break; break;
case SECCAT_BSS: case SECCAT_BSS:
#ifdef BSS_SECTION_ASM_OP #ifdef BSS_SECTION_ASM_OP
bss_section (); bss_section ();
return;
#else #else
named_section (decl, ".bss", reloc); sname = ".bss";
#endif
break; break;
#endif
case SECCAT_SBSS: case SECCAT_SBSS:
named_section (decl, ".sbss", reloc); sname = ".sbss";
break; break;
case SECCAT_TBSS: case SECCAT_TBSS:
named_section (decl, ".tbss", reloc); sname = ".tbss";
break; break;
default: default:
abort (); abort ();
} }
if (!DECL_P (decl))
decl = NULL_TREE;
named_section (decl, sname, reloc);
} }
/* Construct a unique section name based on the decl name and the /* Construct a unique section name based on the decl name and the
......
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