-/* A C statement or statements to switch to the appropriate
- section for output of RTX in mode MODE. RTX is some kind
- of constant in RTL. The argument MODE is redundant except
- in the case of a `const_int' rtx.
- If assembler supports SHF_MERGE sections, put it into
- a .rodata.cstN section where N is size of the constant,
- otherwise into const section. */
-
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \
- mergeable_constant_section ((MODE), (ALIGN), 0)
-
-/* A C statement or statements to switch to the appropriate
- section for output of DECL. DECL is either a `VAR_DECL' node
- or a constant of some sort. RELOC indicates whether forming
- the initial value of DECL requires link-time relocations.
-
- To optimize loading of shared programs, define following subsections
- of data section by attaching:
-
- .rel
- Section with this string in name contains data that do have
- relocations, so they get grouped together and dynamic linker
- will visit fewer pages in memory.
- .ro
- Marks data read only otherwise. This is useful with prelinking
- as most of relocations won't be dynamically linked and thus
- stay read only.
- .local
- Marks data containing relocations only to local objects. These
- relocation will get fully resolved by prelinking.
- */
-
-#undef SELECT_SECTION
-#define SELECT_SECTION(DECL, RELOC, ALIGN) \
-{ \
- if (TREE_CODE (DECL) == STRING_CST) \
- { \
- if (! flag_writable_strings) \
- mergeable_string_section ((DECL), (ALIGN), 0); \
- else \
- data_section (); \
- } \
- else if (TREE_CODE (DECL) == VAR_DECL) \
- { \
- if (!TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
- || !DECL_INITIAL (DECL) \
- || (DECL_INITIAL (DECL) != error_mark_node \
- && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
- { \
- if (flag_pic && ((RELOC) & 2)) \
- named_section (NULL_TREE, ".data.rel", RELOC); \
- else if (flag_pic && (RELOC)) \
- named_section (NULL_TREE, ".data.rel.local", RELOC);\
- else \
- data_section (); \
- } \
- else if (flag_pic && ((RELOC) & 2)) \
- named_section (NULL_TREE, ".data.rel.ro", RELOC); \
- else if (flag_pic && (RELOC)) \
- named_section (NULL_TREE, ".data.rel.ro.local", RELOC); \
- else if (flag_merge_constants < 2) \
- /* C and C++ don't allow different variables to share \
- the same location. -fmerge-all-constants allows \
- even that (at the expense of not conforming). */ \
- const_section (); \
- else if (TREE_CODE (DECL_INITIAL (DECL)) == STRING_CST) \
- mergeable_string_section (DECL_INITIAL (DECL), (ALIGN), \
- 0); \
- else \
- mergeable_constant_section (DECL_MODE (DECL), (ALIGN), \
- 0); \
- } \
- else if (TREE_CODE (DECL) == CONSTRUCTOR) \
- { \
- if ((flag_pic && RELOC) \
- || TREE_SIDE_EFFECTS (DECL) \
- || ! TREE_CONSTANT (DECL)) \
- data_section (); \
- else \
- const_section (); \
- } \
- else \
- const_section (); \
-}