diff options
author | H.J. Lu <hjl@gnu.org> | 2002-08-01 23:29:55 +0000 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-08-01 16:29:55 -0700 |
commit | 4e4d733e19a420252f401c7e5a469abda6a48998 (patch) | |
tree | 194c05431fa23bd64a67f9d0a7826dbb16f016c2 /gcc/varasm.c | |
parent | 32e9b9606f88e84fc2ffe07a094ed70b60633693 (diff) | |
download | gcc-4e4d733e19a420252f401c7e5a469abda6a48998.zip gcc-4e4d733e19a420252f401c7e5a469abda6a48998.tar.gz gcc-4e4d733e19a420252f401c7e5a469abda6a48998.tar.bz2 |
output.h (DECL_READONLY_SECTION): Remove.
* output.h (DECL_READONLY_SECTION): Remove.
(decl_readonly_section): Declare.
* varasm.c (decl_readonly_section): New.
(default_section_type_flags, default_select_section): Use it.
* config/arm/pe.c (arm_pe_unique_section): Likewise.
* config/i386/interix.c (i386_pe_unique_section): Likewise.
* config/i386/winnt.c (i386_pe_unique_section): Likewise.
* config/mcore/mcore.c (mcore_unique_section): Likewise.
* config/mips/mips.c (mips_unique_section): Likewise.
Co-Authored-By: Richard Henderson <rth@redhat.com>
From-SVN: r55957
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index d22cb11..e35d8a2 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -4712,7 +4712,7 @@ default_section_type_flags (decl, name, reloc) if (decl && TREE_CODE (decl) == FUNCTION_DECL) flags = SECTION_CODE; - else if (decl && DECL_READONLY_SECTION (decl, reloc)) + else if (decl && decl_readonly_section (decl, reloc)) flags = 0; else flags = SECTION_WRITE; @@ -4872,7 +4872,7 @@ default_select_section (decl, reloc, align) if (DECL_P (decl)) { - if (DECL_READONLY_SECTION (decl, reloc)) + if (decl_readonly_section (decl, reloc)) readonly = true; } else if (TREE_CODE (decl) == CONSTRUCTOR) @@ -5011,6 +5011,25 @@ categorize_decl_for_section (decl, reloc) return ret; } +bool +decl_readonly_section (decl, reloc) + tree decl; + int reloc; +{ + switch (categorize_decl_for_section (decl, reloc)) + { + case SECCAT_RODATA: + case SECCAT_RODATA_MERGE_STR: + case SECCAT_RODATA_MERGE_STR_INIT: + case SECCAT_RODATA_MERGE_CONST: + return true; + break; + default: + return false; + break; + } +} + /* Select a section based on the above categorization. */ void |