Commit 275b6d80 by David Edelsohn Committed by David Edelsohn

target-def.h (TARGET_HAVE_SRODATA_SECTION): New macro.

        * target-def.h (TARGET_HAVE_SRODATA_SECTION): New macro.
        * target.h (gcc_target): Add have_srodata_section member.
        * varasm.c (section_category): Add SECCAT_SRODATA.
        (categorize_decl_for_section): Return SECCAT_SRODATA for sdata if
        READONLY_SDATA_SECTION defined.
        (decl_readonly_section_1): True for SECCAT_SRODATA also.
        (default_elf_select_section_1): Map SECCAT_SRODATA to .sdata2.
        (default_unique_section_1): Likewise.

From-SVN: r56806
parent 015b1ad1
2002-09-04 David Edelsohn <edelsohn@gnu.org>
* target-def.h (TARGET_HAVE_SRODATA_SECTION): New macro.
* target.h (gcc_target): Add have_srodata_section member.
* varasm.c (section_category): Add SECCAT_SRODATA.
(categorize_decl_for_section): Return SECCAT_SRODATA for sdata if
READONLY_SDATA_SECTION defined.
(decl_readonly_section_1): True for SECCAT_SRODATA also.
(default_elf_select_section_1): Map SECCAT_SRODATA to .sdata2.
(default_unique_section_1): Likewise.
2002-09-04 John David Anglin <dave@hiauly1.hia.nrc.ca>
* expr.c (emit_group_load): Revise to allow splitting TCmode source
......
......@@ -118,6 +118,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_HAVE_TLS false
#endif
#ifndef TARGET_HAVE_SRODATA_SECTION
#define TARGET_HAVE_SRODATA_SECTION false
#endif
#ifndef TARGET_ASM_EXCEPTION_SECTION
#define TARGET_ASM_EXCEPTION_SECTION default_exception_section
#endif
......@@ -224,7 +228,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* In hook.c. */
#define TARGET_CANNOT_MODIFY_JUMPS_P hook_void_bool_false
#ifndef TARGET_IN_SMALL_DATA_P
#define TARGET_IN_SMALL_DATA_P hook_tree_bool_false
#endif
#ifndef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO hook_tree_int_void
......@@ -253,7 +260,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_STRIP_NAME_ENCODING, \
TARGET_HAVE_NAMED_SECTIONS, \
TARGET_HAVE_CTORS_DTORS, \
TARGET_HAVE_TLS \
TARGET_HAVE_TLS, \
TARGET_HAVE_SRODATA_SECTION \
}
#include "hooks.h"
......@@ -262,6 +262,9 @@ struct gcc_target
/* True if thread-local storage is supported. */
bool have_tls;
/* True if a small readonly data section is supported. */
bool have_srodata_section;
};
extern struct gcc_target targetm;
......@@ -4898,6 +4898,7 @@ enum section_category
SECCAT_RODATA_MERGE_STR,
SECCAT_RODATA_MERGE_STR_INIT,
SECCAT_RODATA_MERGE_CONST,
SECCAT_SRODATA,
SECCAT_DATA,
......@@ -4999,6 +5000,8 @@ categorize_decl_for_section (decl, reloc, shlib)
{
if (ret == SECCAT_BSS)
ret = SECCAT_SBSS;
else if (targetm.have_srodata_section && ret == SECCAT_RODATA)
ret = SECCAT_SRODATA;
else
ret = SECCAT_SDATA;
}
......@@ -5026,6 +5029,7 @@ decl_readonly_section_1 (decl, reloc, shlib)
case SECCAT_RODATA_MERGE_STR:
case SECCAT_RODATA_MERGE_STR_INIT:
case SECCAT_RODATA_MERGE_CONST:
case SECCAT_SRODATA:
return true;
break;
default:
......@@ -5069,6 +5073,9 @@ default_elf_select_section_1 (decl, reloc, align, shlib)
case SECCAT_RODATA_MERGE_CONST:
mergeable_constant_section (DECL_MODE (decl), align, 0);
break;
case SECCAT_SRODATA:
named_section (NULL_TREE, ".sdata2", reloc);
break;
case SECCAT_DATA:
data_section ();
break;
......@@ -5141,6 +5148,9 @@ default_unique_section_1 (decl, reloc, shlib)
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:
case SECCAT_DATA_REL:
case SECCAT_DATA_REL_LOCAL:
......
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