diff options
author | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-29 11:29:09 +0000 |
---|---|---|
committer | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-29 11:29:09 +0000 |
commit | 312f7161718ebe1867f96b8ae3eca2c73a398d15 (patch) | |
tree | 1fb1586f0e2bbc68bc57cc5672534e09892616af /gcc | |
parent | 3abf758b4f4fd3553e0a650ada9b5042086a3399 (diff) | |
download | gcc-312f7161718ebe1867f96b8ae3eca2c73a398d15.tar.gz |
* varasm.c (default_elf_select_section_1): Only pass DECL_P decl
to named_section.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91464 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/varasm.c | 38 |
2 files changed, 27 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cd4ff92f30f..4a65e98b915 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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> * opts.c (decode_options): Do not set max-inline-insns-rtl. diff --git a/gcc/varasm.c b/gcc/varasm.c index 09ce14dfcc0..e58422d664d 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -4897,6 +4897,7 @@ void default_elf_select_section_1 (tree decl, int reloc, unsigned HOST_WIDE_INT align, int shlib) { + const char *sname; switch (categorize_decl_for_section (decl, reloc, shlib)) { case SECCAT_TEXT: @@ -4904,56 +4905,61 @@ default_elf_select_section_1 (tree decl, int reloc, abort (); case SECCAT_RODATA: readonly_data_section (); - break; + return; case SECCAT_RODATA_MERGE_STR: mergeable_string_section (decl, align, 0); - break; + return; case SECCAT_RODATA_MERGE_STR_INIT: mergeable_string_section (DECL_INITIAL (decl), align, 0); - break; + return; case SECCAT_RODATA_MERGE_CONST: mergeable_constant_section (DECL_MODE (decl), align, 0); - break; + return; case SECCAT_SRODATA: - named_section (decl, ".sdata2", reloc); + sname = ".sdata2"; break; case SECCAT_DATA: data_section (); - break; + return; case SECCAT_DATA_REL: - named_section (decl, ".data.rel", reloc); + sname = ".data.rel"; break; case SECCAT_DATA_REL_LOCAL: - named_section (decl, ".data.rel.local", reloc); + sname = ".data.rel.local"; break; case SECCAT_DATA_REL_RO: - named_section (decl, ".data.rel.ro", reloc); + sname = ".data.rel.ro"; break; case SECCAT_DATA_REL_RO_LOCAL: - named_section (decl, ".data.rel.ro.local", reloc); + sname = ".data.rel.ro.local"; break; case SECCAT_SDATA: - named_section (decl, ".sdata", reloc); + sname = ".sdata"; break; case SECCAT_TDATA: - named_section (decl, ".tdata", reloc); + sname = ".tdata"; break; case SECCAT_BSS: #ifdef BSS_SECTION_ASM_OP bss_section (); + return; #else - named_section (decl, ".bss", reloc); -#endif + sname = ".bss"; break; +#endif case SECCAT_SBSS: - named_section (decl, ".sbss", reloc); + sname = ".sbss"; break; case SECCAT_TBSS: - named_section (decl, ".tbss", reloc); + sname = ".tbss"; break; default: 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 |