+2002-05-18 Richard Henderson <rth@redhat.com>
+
+ * final.c (HAVE_READONLY_DATA_SECTION): New.
+ (shorten_branches): Use it instead of ifdefs.
+ * varasm.c (enum in_section): Add in_readonly_data.
+ (text_section, data_section): Tidy.
+ (readonly_data_section): Use READONLY_DATA_SECTION_ASM_OP if present.
+
+ * config/darwin.h, config/nextstep.h, config/h8300/elf.h,
+ config/i860/paragon.h, config/m68k/dpx2.h, config/m68k/hp320.h
+ (READONLY_DATA_SECTION): Don't undef.
+
+ * config/alpha/unicosmk.h, config/h8300/elf.h, config/i386/aix386ng.h,
+ config/i860/paragon.h, config/m68k/dpx2.h, config/m68k/hp320.h,
+ config/rs6000/lynx.h (READONLY_DATA_SECTION_ASM_OP): Undef.
+
+ * config/elfos.h, config/svr3.h, config/alpha/alpha-interix.h,
+ config/alpha/elf.h, config/c4x/c4x.h, config/i386/i386-interix.h,
+ config/i386/sco5.h, config/i386/svr3gas.h, config/i860/sysv3.h,
+ config/m88k/m88k.h, config/pa/pa64-hpux.h (USE_CONST_SECTION): Remove.
+
+ * config/elfos.h, config/netware.h, config/alpha/alpha-interix.h,
+ config/alpha/elf.h, config/alpha/vms.h, config/arc/arc.h,
+ config/arm/coff.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h,
+ config/i386/dgux.h, config/i386/i386-interix.h, config/i386/sco5.h,
+ config/ia64/hpux.h, config/m32r/m32r.h, config/m68k/tower-as.h,
+ config/m88k/m88k.h, config/mcore/mcore-pe.h, config/mips/iris6.h,
+ config/mips/mips.h, config/mmix/mmix.h, config/pa/pa64-hpux.h,
+ config/sparc/sysv4.h (READONLY_DATA_SECTION_ASM_OP): Rename from
+ CONST_SECTION_ASM_OP/READONLY_SECTION_ASM_OP/RDATA_SECTION_ASM_OP.
+
+ * config/elfos.h, config/netware.h, config/1750a/1750a.h,
+ config/a29k/a29k.h, config/alpha/alpha-interix.h, config/alpha/alpha.h,
+ config/arm/coff.h, config/h8300/h8300.h, config/i386/aix386ng.h,
+ config/i386/i386-interix.h, config/i386/osfrose.h, config/mmix/mmix.h,
+ config/pa/pa64-hpux.h, config/sparc/litecoff.h
+ (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove.
+
+ * config/elfos.h, config/netware.h, config/svr3.h,
+ config/alpha/alpha-interix.h, config/alpha/alpha.h, config/alpha/elf.h,
+ config/arm/coff.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h,
+ config/h8300/h8300.h, config/i386/i386-interix.h,
+ config/i386/osfrose.h, config/i386/svr3gas.h, config/mmix/mmix.h,
+ config/pa/pa64-hpux.h (READONLY_DATA_SECTION): Remove.
+
+ * config/elfos.h, config/netware.h, config/svr3.h,
+ config/alpha/alpha-interix.h, config/alpha/alpha.h, config/alpha/elf.h,
+ config/c4x/c4x.h, config/i386/aix386ng.h, config/i386/i386-interix.h,
+ config/i386/sco5.h, config/i386/svr3gas.h, config/mmix/mmix.h,
+ config/pa/pa64-hpux.h (CONST_SECTION_FUNCTION): Remove.
+
+ * config/lynx.h, config/svr3.h, config/alpha/elf.h, config/alpha/vms.h,
+ config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/i386/sco5.h,
+ config/i386/svr3gas.h, config/i860/sysv3.h, config/i860/sysv4.h,
+ config/ia64/sysv4.h, config/m32r/m32r.h, config/m88k/m88k.h,
+ config/mcore/mcore-elf.h, config/mcore/mcore-pe.h, config/mips/elf.h,
+ config/mips/elf64.h, config/mips/iris6.h, config/mips/linux.h,
+ config/mips/mips.h, config/mips/rtems64.h, config/mips/vxworks.h,
+ config/rs6000/sysv4.h, config/v850/v850.h
+ (EXTRA_SECTIONS): Remove in_const/in_rdata.
+ (EXTRA_SECTION_FUNCTIONS): Remove accompanying function.
+
+ * config/svr3.h, config/c4x/c4x.h, config/i386/dgux.h,
+ config/i386/sco5.h, config/i386/svr3gas.h, config/ia64/aix.h,
+ config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mmix/mmix.h,
+ config/sparc/sysv4.h (SELECT_RTX_SECTION): Use readonly_data_section.
+ * config/alpha/alpha.c (alpha_start_function): Likewise.
+ (alpha_write_linkage): Likewise.
+ * config/m32r/m32r.c (m32r_select_section): Likewise.
+ * config/m88k/m88k.c (m88k_select_section): Likewise.
+ * config/mips/mips.c (mips_select_rtx_section): Likewise.
+ * config/rs6000/rs6000.c (rs6000_select_rtx_section): Likewise.
+ (rs6000_elf_select_section): Likewise.
+ * config/v850/v850.c (v850_select_section): Likewise.
+
+ * config/1750a/1750a.h, config/i860/sysv3.h
+ (READONLY_DATA_SECTION_ASM_OP): New.
+ READONLY_DATA_SECTION_ASM_OP.
+ * config/i386/interix.c, config/i386/winnt.c
+ (i386_pe_unique_section): Always use .rdata prefix.
+ * config/pa/som.h (readonly_data): Always switch to read-only section.
+ (READONLY_DATA_SECTION): Predicate on flag_pic.
+ * config/we32k/we32k.h (READONLY_DATA_SECTION): Remove parenthesis.
+ * doc/tm.texi (READONLY_DATA_SECTION_ASM_OP): New.
+ (READONLY_DATA_SECTION): Update.
+
2002-05-18 Jason Thorpe <thorpej@wasabisystems.com>
* c-common.c (c_common_post_options): Warn if -Wformat-zero-length
#define ASM_APP_OFF "; ASM_APP_OFF\n"
-
-#define EXTRA_SECTIONS in_readonly_data
-
#define EXTRA_SECTION_FUNCTIONS \
- extern void const_section PARAMS ((void)); \
- void const_section() \
- { \
- fprintf(asm_out_file,"\tkonst\n"); \
- current_section = Konst; \
- } \
void check_section(sect) \
enum section sect; \
{ \
} \
}
-
-/* Function that switches to the read-only data section (optional) */
-#define READONLY_DATA_SECTION const_section
+#define READONLY_DATA_SECTION_ASM_OP "\tkonst"
/* Output before program init section */
#define INIT_SECTION_ASM_OP "\n\tinit ; init_section\n"
#define DATA_SECTION_ASM_OP "\t.data"
-/* Define an extra section for read-only data, a routine to enter it, and
- indicate that it is for read-only data. */
-
-#define EXTRA_SECTIONS readonly_data
-
-#define EXTRA_SECTION_FUNCTIONS \
-void \
-literal_section () \
-{ \
- if (in_section != readonly_data) \
- { \
- fprintf (asm_out_file, "%s\n", READONLY_DATA_SECTION_ASM_OP); \
- in_section = readonly_data; \
- } \
-} \
-
-#define READONLY_DATA_SECTION literal_section
-
/* If we are referencing a function that is static or is known to be
in this file, make the SYMBOL_REF special. We can use this to indicate
that we can branch to this function without emitting a no-op after the
/* Support const sections and the ctors and dtors sections for g++. */
-#define USE_CONST_SECTION 1
-
-#define CONST_SECTION_ASM_OP "\t.rdata"
+#define READONLY_DATA_SECTION_ASM_OP "\t.rdata"
/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
#define CTORS_SECTION_ASM_OP "\t.ctors"
#define DTORS_SECTION_ASM_OP "\t.dtors"
-/* A default list of other sections which we might be "in" at any given
- time. For targets that use additional sections (e.g. .tdesc) you
- should override this definition in the target-specific file which
- includes this file. */
-
-#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const
-
-/* A default list of extra section function definitions. For targets
- that use additional sections (e.g. .tdesc) you should override this
- definition in the target-specific file which includes this file. */
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION
-
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION() const_section ()
-
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (!USE_CONST_SECTION) \
- text_section(); \
- else if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
-
/* The linker will take care of this, and having them causes problems with
ld -r (specifically -rU). */
#define CTOR_LISTS_DEFINED_EXTERNALLY 1
}
#if TARGET_ABI_OPEN_VMS
- /* Ifdef'ed cause readonly_section and link_section are only
- available then. */
- readonly_section ();
+ /* Ifdef'ed cause link_section are only available then. */
+ readonly_data_section ();
fprintf (file, "\t.align 3\n");
assemble_name (file, fnname); fputs ("..na:\n", file);
fputs ("\t.ascii \"", file);
assemble_name (file, fnname);
fputs ("\\0\"\n", file);
-
+
link_section ();
fprintf (file, "\t.align 3\n");
fputs ("\t.name ", file);
{
if (alpha_links)
{
- readonly_section ();
+ readonly_data_section ();
fprintf (stream, "\t.align 3\n");
splay_tree_foreach (alpha_links, alpha_write_one_linkage, stream);
}
#define DATA_SECTION_ASM_OP "\t.data"
-/* Define an extra section for read-only data, a routine to enter it, and
- indicate that it is for read-only data.
-
- The first time we enter the readonly data section for a file, we write
- eight bytes of zero. This works around a bug in DEC's assembler in
- some versions of OSF/1 V3.x. */
-
-#define EXTRA_SECTIONS readonly_data
-
-#define EXTRA_SECTION_FUNCTIONS \
-void \
-literal_section () \
-{ \
- if (in_section != readonly_data) \
- { \
- static int firsttime = 1; \
- \
- fprintf (asm_out_file, "%s\n", READONLY_DATA_SECTION_ASM_OP); \
- if (firsttime) \
- { \
- firsttime = 0; \
- assemble_aligned_integer (8, const0_rtx); \
- } \
- \
- in_section = readonly_data; \
- } \
-} \
-
-#define READONLY_DATA_SECTION literal_section
-
/* Define this macro if references to a symbol must be treated differently
depending on something about the variable or function named by the symbol
(such as what section it is in). */
#undef ASCII_DATA_ASM_OP
#define ASCII_DATA_ASM_OP "\t.ascii\t"
-/* Support const sections and the ctors and dtors sections for g++. */
-
-#undef USE_CONST_SECTION
-#define USE_CONST_SECTION 1
-
-#undef CONST_SECTION_ASM_OP
-#define CONST_SECTION_ASM_OP "\t.section\t.rodata"
-
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata"
#undef BSS_SECTION_ASM_OP
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
#undef SBSS_SECTION_ASM_OP
includes this file. */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_sbss, in_sdata
+#define EXTRA_SECTIONS in_sbss, in_sdata
/* A default list of extra section function definitions. For targets
that use additional sections (e.g. .tdesc) you should override this
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP) \
SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP)
extern void sbss_section PARAMS ((void));
extern void sdata_section PARAMS ((void));
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION() const_section ()
-
-#undef CONST_SECTION_FUNCTION
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (!USE_CONST_SECTION) \
- text_section(); \
- else if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
-
#undef SECTION_FUNCTION_TEMPLATE
#define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
void FN () \
#undef DATA_SECTION_ASM_OP
#define DATA_SECTION_ASM_OP unicosmk_data_section ()
-/* There are ni read-only sections on Unicos/Mk. */
+/* There are no read-only sections on Unicos/Mk. */
-#undef READONLY_DATA_SECTION
+#undef READONLY_DATA_SECTION_ASM_OP
#define READONLY_DATA_SECTION data_section
/* Define extra sections for common data and SSIBs (static subroutine
}
#define LINK_SECTION_ASM_OP "\t.link"
-#define READONLY_SECTION_ASM_OP "\t.rdata"
+#define READONLY_DATA_SECTION_ASM_OP "\t.rdata"
#define LITERALS_SECTION_ASM_OP "\t.literals"
#define CTORS_SECTION_ASM_OP "\t.ctors"
#define DTORS_SECTION_ASM_OP "\t.dtors"
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_link, in_rdata, in_literals
+#define EXTRA_SECTIONS in_link, in_literals
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
void \
-readonly_section () \
-{ \
- if (in_section != in_rdata) \
- { \
- fprintf (asm_out_file, "%s\n", READONLY_SECTION_ASM_OP); \
- in_section = in_rdata; \
- } \
-} \
-void \
link_section () \
{ \
if (in_section != in_link) \
} \
}
-extern void readonly_section PARAMS ((void));
extern void link_section PARAMS ((void));
extern void literals_section PARAMS ((void));
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
fprintf (FILE, "\t.quad $L%d\n", (VALUE))
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION readonly_section
-
#define ASM_FILE_END(FILE) alpha_write_linkage (FILE);
#undef CASE_VECTOR_MODE
#if defined (CRT_INIT) || defined (CRT_FINI)
#define TEXT_SECTION_ASM_OP "\t.section .text"
#else
-#define TEXT_SECTION_ASM_OP arc_text_section /*"\t.section .text"*/
+#define TEXT_SECTION_ASM_OP arc_text_section
#endif
-#define DATA_SECTION_ASM_OP arc_data_section /*"\t.section .data"*/
+#define DATA_SECTION_ASM_OP arc_data_section
-#undef CONST_SECTION_ASM_OP
-#define CONST_SECTION_ASM_OP arc_rodata_section /*"\t.section .rodata"*/
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP arc_rodata_section
#define BSS_SECTION_ASM_OP "\t.section .bss"
/* ADDR_VECs only take room if read-only data does into the text
section. */
if (JUMP_TABLES_IN_TEXT_SECTION
-#if !defined(READONLY_DATA_SECTION)
+#if !defined(READONLY_DATA_SECTION) && !defined(READONLY_DATA_SECTION_ASM_OP)
|| 1
#endif
)
/* Definitions of target machine for GNU compiler.
For ARM with COFF object format.
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002
Free Software Foundation, Inc.
Contributed by Doug Evans (devans@cygnus.com).
more efficient, but for Thumb it's better to put them out of band. */
#define JUMP_TABLES_IN_TEXT_SECTION (TARGET_ARM)
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION rdata_section
-#undef RDATA_SECTION_ASM_OP
-#define RDATA_SECTION_ASM_OP "\t.section .rdata"
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP "\t.section .rdata"
#undef CTORS_SECTION_ASM_OP
#define CTORS_SECTION_ASM_OP "\t.section .ctors,\"x\""
#undef DTORS_SECTION_ASM_OP
#define DTORS_SECTION_ASM_OP "\t.section .dtors,\"x\""
-
-/* A list of other sections which the compiler might be "in" at any
- given time. */
-
-#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS SUBTARGET_EXTRA_SECTIONS in_rdata
-
-#define SUBTARGET_EXTRA_SECTIONS
-
-/* A list of extra section function definitions. */
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS \
- RDATA_SECTION_FUNCTION \
- SUBTARGET_EXTRA_SECTION_FUNCTIONS
-
-#define SUBTARGET_EXTRA_SECTION_FUNCTIONS
-
-#define RDATA_SECTION_FUNCTION \
-void \
-rdata_section () \
-{ \
- if (in_section != in_rdata) \
- { \
- fprintf (asm_out_file, "%s\n", RDATA_SECTION_ASM_OP); \
- in_section = in_rdata; \
- } \
-}
\f
/* Support the ctors/dtors sections for g++. */
#define DATA_SECTION_ASM_OP "\t.data"
-#define USE_CONST_SECTION 1
-
-#define CONST_SECTION_ASM_OP "\t.sect\t\".const\""
+#define READONLY_DATA_SECTION_ASM_OP "\t.sect\t\".const\""
/* Do not use .init section so __main will be called on startup. This will
call __do_global_ctors and prepare for __do_global_dtors on exit. */
#define FINI_SECTION_ASM_OP "\t.sect\t\".fini\""
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_init, in_fini
+#define EXTRA_SECTIONS in_init, in_fini
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
INIT_SECTION_FUNCTION \
FINI_SECTION_FUNCTION
} \
}
-#define READONLY_DATA_SECTION() const_section ()
-
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (! USE_CONST_SECTION) \
- text_section(); \
- else if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
-
#define ASM_STABS_OP "\t.stabs\t"
/* Switch into a generic section. */
in the case of a `const_int' rtx. Currently, these always
go into the const section. */
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) const_section()
+#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) readonly_data_section()
/* Overall Framework of an Assembler File. */
Defined in svr4.h. */
/* #define EXTRA_SECTION_FUNCTIONS */
-/* On most machines, read-only variables, constants, and jump tables are placed
- in the text section. If this is not the case on your machine, this macro
- should be defined to be the name of a function (either `data_section' or a
- function defined in `EXTRA_SECTIONS') that switches to the section to be
- used for read-only items.
-
- If these items should be placed in the text section, this macro should not
- be defined. */
-/* #define READONLY_DATA_SECTION */
-
/* A C statement or statements to switch to the appropriate section for output
of RTX in mode MODE. You can assume that RTX is some kind of constant in
RTL. The argument MODE is redundant except in the case of a `const_int'
} \
}
-#undef READONLY_DATA_SECTION
#define READONLY_DATA_SECTION const_section
#undef TARGET_ASM_SELECT_SECTION
/* Output before constants and strings */
#define DEFAULT_CONST_SEG_NAME ".const"
-#define READONLY_SECTION_ASM_OP rsect_const
-#define READONLY_DATA_SECTION const_section
+#define READONLY_DATA_SECTION_ASM_OP rsect_const
/* Output before writable data. */
#define DEFAULT_DATA_SEG_NAME ".data"
/* We will default to using 1610 if the user doesn't
specify it. */
#define DEFAULT_CHIP_NAME "1610"
-
-/* A list of names for sections other than the standard ones, which are
- 'in_text' and 'in_data' (and .bss if BSS_SECTION_ASM_OP is defined). */
-#define EXTRA_SECTIONS in_const
-
-#define EXTRA_SECTION_FUNCTIONS \
-extern void const_section PARAMS ((void)); \
-void \
-const_section () \
-{ \
- if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", READONLY_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
\f
/* THE OVERALL FRAMEWORK OF AN ASSEMBLER FILE */
#undef ASCII_DATA_ASM_OP
#define ASCII_DATA_ASM_OP "\t.ascii\t"
-/* Support const sections and the ctors and dtors sections for g++. */
-
-#define USE_CONST_SECTION 1
-#define CONST_SECTION_ASM_OP "\t.section\t.rodata"
+/* Support a read-only data section. */
+#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata"
/* On svr4, we *do* have support for the .init and .fini sections, and we
can put stuff in there to be executed before and after `main'. We let
#define INIT_SECTION_ASM_OP "\t.section\t.init"
#define FINI_SECTION_ASM_OP "\t.section\t.fini"
-#ifdef HAVE_GAS_SUBSECTION_ORDERING
-
-#define ASM_SECTION_START_OP "\t.subsection\t-1"
-
/* Output assembly directive to move to the beginning of current section. */
-#define ASM_OUTPUT_SECTION_START(FILE) \
+#ifdef HAVE_GAS_SUBSECTION_ORDERING
+# define ASM_SECTION_START_OP "\t.subsection\t-1"
+# define ASM_OUTPUT_SECTION_START(FILE) \
fprintf ((FILE), "%s\n", ASM_SECTION_START_OP)
-
#endif
-/* A default list of other sections which we might be "in" at any given
- time. For targets that use additional sections (e.g. .tdesc) you
- should override this definition in the target-specific file which
- includes this file. */
-
-#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const
-
-/* A default list of extra section function definitions. For targets
- that use additional sections (e.g. .tdesc) you should override this
- definition in the target-specific file which includes this file. */
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION
-
-#define READONLY_DATA_SECTION() const_section ()
-
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (!USE_CONST_SECTION) \
- text_section (); \
- else if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
-
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
/* Switch into a generic section. */
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
#undef INIT_SECTION_ASM_OP
-#undef READONLY_DATA_SECTION
+#undef READONLY_DATA_SECTION_ASM_OP
#undef TARGET_ASM_NAMED_SECTION
#undef TARGET_MEM_FUNCTIONS
#undef PREFERRED_DEBUGGING_TYPE
/* The assembler op to get a word, 2 bytes for the H8/300, 4 for H8/300H. */
#define ASM_WORD_OP (TARGET_H8300 ? "\t.word\t" : "\t.long\t")
-/* We define a readonly data section solely to remove readonly data
- from the instruction stream. This can improve relaxing in two significant
- ways. First it's more likely that references to readonly data
- can be done with a 16bit absolute address since they'll be in low
- memory. Second, it's more likely that jsr instructions can be
- turned into bsr instructions since read-only data is not in the
- instruction stream. */
-#define READONLY_DATA_SECTION readonly_data
-
#define TEXT_SECTION_ASM_OP "\t.section .text"
#define DATA_SECTION_ASM_OP "\t.section .data"
#define BSS_SECTION_ASM_OP "\t.section .bss"
#define INIT_SECTION_ASM_OP "\t.section .init"
#define READONLY_DATA_SECTION_ASM_OP "\t.section .rodata"
-#define EXTRA_SECTIONS in_readonly_data
-
-#define EXTRA_SECTION_FUNCTIONS \
-extern void readonly_data PARAMS ((void)); \
-void \
-readonly_data () \
-{ \
- if (in_section != in_readonly_data) \
- { \
- fprintf (asm_out_file, "%s\n", READONLY_DATA_SECTION_ASM_OP); \
- in_section = in_readonly_data; \
- } \
-}
-
#undef DO_GLOBAL_CTORS_BODY
#define DO_GLOBAL_CTORS_BODY \
{ \
* cannot handle those.
*/
#ifndef USE_GAS
+# undef READONLY_DATA_SECTION_ASM_OP
# undef INIT_SECTION_ASM_OP
# undef FINI_SECTION_ASM_OP
# undef CTORS_SECTION_ASM_OP
# undef DTOR_LIST_END
# define DTOR_LIST_END
-# undef CONST_SECTION_FUNCTION
-# define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- text_section(); \
-}
-
-# undef EXTRA_SECTION_FUNCTIONS
-# define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION
-
/* for collect2 */
# define OBJECT_FORMAT_COFF
# define MY_ISCOFF(magic) \
/* Target definitions for GNU compiler for Intel 80x86 running DG/ux
- Copyright (C) 1993, 1995, 1996, 1997, 1998, 2000, 2001
+ Copyright (C) 1993, 1995, 1996, 1997, 1998, 2000, 2001, 2002
Free Software Foundation, Inc.
Currently maintained by gcc@dg-rtp.dg.com.
*/
#ifndef VERSION_INFO2
-#define VERSION_INFO2 "$Revision: 1.16 $"
+#define VERSION_INFO2 "$Revision: 1.17 $"
#endif
#ifndef VERSION_STRING
/* Must use data section for relocatable constants when pic. */
#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \
-{ \
- if (flag_pic && symbolic_operand (RTX, VOIDmode)) \
- data_section (); \
- else \
- const_section (); \
-}
+#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \
+do { \
+ if (flag_pic && symbolic_operand (RTX, VOIDmode)) \
+ data_section (); \
+ else \
+ readonly_data_section (); \
+} while (0)
/* This supplements FUNCTION_ARG's definition in i386.h to check
TARGET_WARN_PASS_STRUCT */
(function_arg (&CUM, MODE, TYPE, NAMED)))
/* Add .align 1 to avoid .backalign bug in assembler */
-#undef CONST_SECTION_ASM_OP
-#define CONST_SECTION_ASM_OP "\t.section\t.rodata\n\t.align 1"
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata\n\t.align 1"
#define EH_FRAME_IN_DATA_SECTION
-#define USE_CONST_SECTION 1
-
-#define CONST_SECTION_ASM_OP "\t.section\t.rdata,\"r\""
-
-/* A default list of other sections which we might be "in" at any given
- time. For targets that use additional sections (e.g. .tdesc) you
- should override this definition in the target-specific file which
- includes this file. */
-
-#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const
-
-/* A default list of extra section function definitions. For targets
- that use additional sections (e.g. .tdesc) you should override this
- definition in the target-specific file which includes this file. */
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION
-
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION() const_section ()
-
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (!USE_CONST_SECTION) \
- text_section(); \
- else if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
+#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rdata,\"r\""
/* The MS compilers take alignment as a number of bytes, so we do as well */
#undef ASM_OUTPUT_ALIGN
/* Subroutines for insn-output.c for Windows NT.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
without a .rdata section. */
if (TREE_CODE (decl) == FUNCTION_DECL)
prefix = ".text$";
-/* else if (DECL_INITIAL (decl) == 0
- || DECL_INITIAL (decl) == error_mark_node)
- prefix = ".bss"; */
else if (DECL_READONLY_SECTION (decl, reloc))
-#ifdef READONLY_DATA_SECTION
prefix = ".rdata$";
-#else
- prefix = ".text$";
-#endif
else
prefix = ".data$";
len = strlen (name) + strlen (prefix);
} \
while (0)
-
-/* On most machines, read-only variables, constants, and jump tables
- are placed in the text section. If this is not the case on your
- machine, this macro should be defined to be the name of a function
- (either `data_section' or a function defined in `EXTRA_SECTIONS')
- that switches to the section to be used for read-only items.
-
- If these items should be placed in the text section, this macro
- should not be defined. */
-
-#if 0
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION() \
-do \
- { \
- if (TARGET_ELF) \
- { \
- if (in_section != in_rodata) \
- { \
- fprintf (asm_out_file, "\t.section \"rodata\"\n"); \
- in_section = in_rodata; \
- } \
- } \
- else \
- text_section (); \
- } \
-while (0)
-#endif
-
-/* A list of names for sections other than the standard two, which are
- `in_text' and `in_data'. You need not define this macro on a
- system with no other sections (that GCC needs to use). */
-
-#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_rodata, in_data1
-
/* Given a decl node or constant node, choose the section to output it in
and select that section. */
#define DWARF2_UNWIND_INFO \
((TARGET_ELF) ? 1 : 0 )
-#undef CONST_SECTION_ASM_OP
-#define CONST_SECTION_ASM_OP_COFF "\t.section\t.rodata, \"x\""
-#define CONST_SECTION_ASM_OP_ELF "\t.section\t.rodata"
-#define CONST_SECTION_ASM_OP \
- ((TARGET_ELF) ? CONST_SECTION_ASM_OP_ELF : CONST_SECTION_ASM_OP_COFF)
-
-#undef USE_CONST_SECTION
-#define USE_CONST_SECTION_ELF 1
-#define USE_CONST_SECTION_COFF 0
-#define USE_CONST_SECTION \
- ((TARGET_ELF) ? USE_CONST_SECTION_ELF : USE_CONST_SECTION_COFF)
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP_COFF "\t.section\t.rodata, \"x\""
+#define READONLY_DATA_SECTION_ASM_OP_ELF "\t.section\t.rodata"
+#define READONLY_DATA_SECTION_ASM_OP \
+ ((TARGET_ELF) \
+ ? READONLY_DATA_SECTION_ASM_OP_ELF \
+ : READONLY_DATA_SECTION_ASM_OP_COFF)
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP_ELF "\t.section\t.init"
/* Must use data section for relocatable constants when pic. */
#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \
-{ \
- if (TARGET_ELF) { \
- if (flag_pic && symbolic_operand (RTX, VOIDmode)) \
- data_section (); \
- else \
- const_section (); \
- } else \
- readonly_data_section(); \
+#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \
+{ \
+ if (TARGET_ELF) { \
+ if (flag_pic && symbolic_operand (RTX, VOIDmode)) \
+ data_section (); \
+ else \
+ readonly_data_section (); \
+ } else \
+ readonly_data_section(); \
}
#undef ASM_OUTPUT_CASE_LABEL
((TARGET_ELF) ? DWARF2_DEBUG: SDB_DEBUG)
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_init, in_fini
+#define EXTRA_SECTIONS in_init, in_fini
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
INIT_SECTION_FUNCTION \
FINI_SECTION_FUNCTION
-#undef CONST_SECTION_FUNCTION
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (!USE_CONST_SECTION) \
- text_section(); \
- else if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
-
#undef FINI_SECTION_FUNCTION
#define FINI_SECTION_FUNCTION \
void \
this file should be rewritten to include config/svr3.h
and override what isn't right. */
-/* Support const sections and the ctors and dtors sections for g++. */
-
-#define USE_CONST_SECTION 0
-
#define INIT_SECTION_ASM_OP "\t.section\t.init"
#define FINI_SECTION_ASM_OP "\t.section .fini,\"x\""
-#define CONST_SECTION_ASM_OP "\t.section\t.rodata, \"x\""
#define CTORS_SECTION_ASM_OP INIT_SECTION_ASM_OP
#define DTORS_SECTION_ASM_OP FINI_SECTION_ASM_OP
(*--p) (); \
} while (0)
-/* Add extra sections .rodata, .init and .fini. */
-
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_init, in_fini
+#define EXTRA_SECTIONS in_init, in_fini
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
INIT_SECTION_FUNCTION \
FINI_SECTION_FUNCTION
} \
}
-#define READONLY_DATA_SECTION() const_section ()
-
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (!USE_CONST_SECTION) \
- text_section(); \
- else if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
-
#define TARGET_ASM_CONSTRUCTOR ix86_svr3_asm_out_constructor
/* A C statement or statements to switch to the appropriate
in the case of a `const_int' rtx. Currently, these always
go into the const section. */
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) const_section()
+#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) readonly_data_section()
without a .rdata section. */
if (TREE_CODE (decl) == FUNCTION_DECL)
prefix = ".text$";
-/* else if (DECL_INITIAL (decl) == 0
- || DECL_INITIAL (decl) == error_mark_node)
- prefix = ".bss"; */
else if (DECL_READONLY_SECTION (decl, reloc))
-#ifdef READONLY_DATA_SECTION
prefix = ".rdata$";
-#else
- prefix = ".text$";
-#endif
else
prefix = ".data$";
len = strlen (name) + strlen (prefix);
*/
#undef INIT_SECTION_ASM_OP
#undef FINI_SECTION_ASM_OP
-#undef CONST_SECTION_ASM_OP
+#undef READONLY_DATA_SECTION_ASM_OP
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
#undef DO_GLOBAL_CTORS_BODY
#undef ASM_OUTPUT_DESTRUCTOR
#undef TARGET_ASM_SELECT_SECTION
#undef SELECT_RTX_SECTION
-#undef READONLY_DATA_SECTION
#define BSS_SECTION_ASM_OP "\t.bss" /* XXX */
#undef EXTRA_SECTIONS
/* Target definitions for GNU compiler for Intel 80860 running System V.3
- Copyright (C) 1991, 1996, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1996, 2000, 2002 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com).
This file is part of GNU CC.
while (0)
+#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata, \"x\""
#undef CTORS_SECTION_ASM_OP
#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"x\""
#undef DTORS_SECTION_ASM_OP
#define TDESC_SECTION_ASM_OP "\t.section\t.tdesc"
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_tdesc
+#define EXTRA_SECTIONS in_tdesc
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
TDESC_SECTION_FUNCTION
#define TDESC_SECTION_FUNCTION \
in_section = in_tdesc; \
} \
}
-
-/* Enable the `const' section that svr3.h defines how to use. */
-#undef USE_CONST_SECTION
-#define USE_CONST_SECTION 1
/* Target definitions for GNU compiler for Intel 80860 running System V.4
- Copyright (C) 1991, 1996, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1996, 2000, 2002 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com).
This file is part of GNU CC.
#define TDESC_SECTION_ASM_OP "\t.section\t.tdesc"
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_tdesc
+#define EXTRA_SECTIONS in_tdesc
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
TDESC_SECTION_FUNCTION
#define TDESC_SECTION_FUNCTION \
extern unsigned int ia64_section_threshold;
#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \
-{ \
- if (GET_MODE_SIZE (MODE) > 0 \
- && GET_MODE_SIZE (MODE) <= ia64_section_threshold) \
- sdata_section (); \
- else if (symbolic_operand ((RTX), (MODE))) \
- data_section (); \
- else \
- const_section (); \
+#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \
+{ \
+ if (GET_MODE_SIZE (MODE) > 0 \
+ && GET_MODE_SIZE (MODE) <= ia64_section_threshold) \
+ sdata_section (); \
+ else if (symbolic_operand ((RTX), (MODE))) \
+ data_section (); \
+ else \
+ readonly_data_section (); \
}
/* Override ia64/sysv4.h setting with that used by AIX5. */
/* Definitions of target machine GNU compiler. IA-64 version.
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Steve Ellcey <sje@cup.hp.com> and
Reva Cuthbertson <reva@cup.hp.com>
#define JMP_BUF_SIZE (8 * 76)
-#undef CONST_SECTION_ASM_OP
-#define CONST_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP \
+ "\t.section\t.rodata,\t\"a\",\t\"progbits\""
#undef BITS_BIG_ENDIAN
#define BITS_BIG_ENDIAN 1
}
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_sdata, in_sbss
+#define EXTRA_SECTIONS in_sdata, in_sbss
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
SDATA_SECTION_FUNCTION \
SBSS_SECTION_FUNCTION
/* Target independent definitions for LynxOS.
- Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002
+ Free Software Foundation, Inc.
This file is part of GNU CC.
#undef INIT_SECTION_ASM_OP
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_fini
+#define EXTRA_SECTIONS in_fini
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
FINI_SECTION_FUNCTION
#undef CTORS_SECTION_ASM_OP
if (TREE_CODE (decl) == STRING_CST)
{
if (! flag_writable_strings)
- const_section ();
+ readonly_data_section ();
else
data_section ();
}
&& !TREE_CONSTANT (DECL_INITIAL (decl))))
data_section ();
else
- const_section ();
+ readonly_data_section ();
}
else
- const_section ();
+ readonly_data_section ();
}
/* Encode section information of DECL, which is either a VAR_DECL,
#define SDATA_SECTION_ASM_OP "\t.section .sdata"
#define SBSS_SECTION_ASM_OP "\t.section .sbss"
/* This one is for svr4.h. */
-#undef CONST_SECTION_ASM_OP
-#define CONST_SECTION_ASM_OP "\t.section .rodata"
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP "\t.section .rodata"
/* A list of names for sections other than the standard two, which are
`in_text' and `in_data'. You need not define this macro
on a system with no other sections (that GCC needs to use). */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_sdata, in_sbss, in_const
+#define EXTRA_SECTIONS in_sdata, in_sbss
/* One or more functions to be defined in "varasm.c". These
functions should do jobs analogous to those of `text_section' and
macro if you do not define `EXTRA_SECTIONS'. */
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
SDATA_SECTION_FUNCTION \
SBSS_SECTION_FUNCTION
#undef SELECT_RTX_SECTION
#undef EXTRA_SECTIONS
#undef EXTRA_SECTION_FUNCTIONS
-#undef CONST_SECTION_ASM_OP
-#undef READONLY_DATA_SECTION
+#undef READONLY_DATA_SECTION_ASM_OP
#define DPX2
/* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version.
- Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1999, 2000
+ Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2002
Free Software Foundation, Inc.
This file is part of GNU CC.
#undef ASM_APP_OFF
#undef TEXT_SECTION_ASM_OP
#undef DATA_SECTION_ASM_OP
-#undef READONLY_DATA_SECTION
+#undef READONLY_DATA_SECTION_ASM_OP
#undef ASM_OUTPUT_ADDR_VEC_ELT
#undef ASM_OUTPUT_ADDR_DIFF_ELT
#undef ASM_OUTPUT_ALIGN
/* Definitions of target machine for GNU compiler.
For NCR Tower 32/4x0 and 32/6x0 running System V Release 3.
- Copyright (C) 1990, 1993, 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1993, 1994, 1996, 1997, 2000, 2002
+ Free Software Foundation, Inc.
Contributed by Robert Andersson (ra@intsys.no), International Systems,
Oslo, Norway.
#define INIT_SECTION_ASM_OP "\tsection\t~init"
#undef FINI_SECTION_ASM_OP
#define FINI_SECTION_ASM_OP "\tsection\t~fini"
-#undef CONST_SECTION_ASM_OP
-#define CONST_SECTION_ASM_OP "\tsection\t~rodata"
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP "\tsection\t~rodata"
#define CTOR_LIST_BEGIN \
asm (INIT_SECTION_ASM_OP); \
/* Definitions of target machine for GNU compiler.
Motorola m88100 running DG/UX.
- Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001
+ Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@mcc.com)
Currently maintained by (gcc@dg-rtp.dg.com)
/* Must use data section for relocatable constants when pic. */
#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \
-{ \
- if (flag_pic && symbolic_operand ((RTX), (MODE))) \
- data_section (); \
- else \
- const_section (); \
+#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \
+{ \
+ if (flag_pic && symbolic_operand ((RTX), (MODE))) \
+ data_section (); \
+ else \
+ readonly_data_section (); \
}
if (TREE_CODE (decl) == STRING_CST)
{
if (! flag_writable_strings)
- const_section ();
+ readonly_data_section ();
else if (TREE_STRING_LENGTH (decl) <= m88k_gp_threshold)
sdata_section ();
else
&& !TREE_CONSTANT (DECL_INITIAL (decl))))
data_section ();
else
- const_section ();
+ readonly_data_section ();
}
else
- const_section ();
+ readonly_data_section ();
}
/* Adjust the cost of INSN based on the relationship between INSN that
/* Allow pseudo-ops to be overridden. Override these in svr[34].h. */
#undef ASCII_DATA_ASM_OP
-#undef CONST_SECTION_ASM_OP
+#undef READONLY_DATA_SECTION_ASM_OP
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
#undef TARGET_ASM_NAMED_SECTION
#define DATA_SECTION_ASM_OP "\tdata"
/* Other sections. */
-#define CONST_SECTION_ASM_OP (TARGET_SVR4 \
+#define READONLY_DATA_SECTION_ASM_OP (TARGET_SVR4 \
? "\tsection\t .rodata,\"a\"" \
: "\tsection\t .rodata,\"x\"")
#define TDESC_SECTION_ASM_OP (TARGET_SVR4 \
and so follows DECLARE_ASM_NAME. Note that strings go in text
rather than const. Override svr[34].h. */
-#undef USE_CONST_SECTION
#undef EXTRA_SECTIONS
-#define USE_CONST_SECTION DECLARE_ASM_NAME
-
#if defined(USING_SVR4_H)
-#define EXTRA_SECTIONS in_const, in_tdesc, in_sdata
+#define EXTRA_SECTIONS in_tdesc, in_sdata
#define INIT_SECTION_FUNCTION
#define FINI_SECTION_FUNCTION
#else
#if defined(USING_SVR3_H)
-#define EXTRA_SECTIONS in_const, in_tdesc, in_sdata, in_init, in_fini
+#define EXTRA_SECTIONS in_tdesc, in_sdata, in_init, in_fini
#else /* luna or other not based on svr[34].h. */
+#undef READONLY_DATA_SECTION_ASM_OP
#undef INIT_SECTION_ASM_OP
-#define EXTRA_SECTIONS in_const, in_tdesc, in_sdata
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- text_section(); \
-}
+#define EXTRA_SECTIONS in_tdesc, in_sdata
#define INIT_SECTION_FUNCTION
#define FINI_SECTION_FUNCTION
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
- \
void \
tdesc_section () \
{ \
#define EXPORTS_SECTION_ASM_OP "\t.section .exports"
-#define SUBTARGET_EXTRA_SECTIONS in_const, in_exports
+#define SUBTARGET_EXTRA_SECTIONS in_exports
#define SUBTARGET_EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
- EXPORT_SECTION_FUNCTION \
-
-/* CONST_SECTION_FUNCTION is defined svr4.h. */
+ EXPORT_SECTION_FUNCTION
#define EXPORT_SECTION_FUNCTION \
void \
}
#define SUBTARGET_SWITCH_SECTIONS \
- case in_exports: exports_section (); break; \
- case in_const: const_section (); break;
+ case in_exports: exports_section (); break;
#define MCORE_EXPORT_NAME(STREAM, NAME) \
and readonly data. This gets them out of default places. */
#define SUBTARGET_SWITCH_SECTIONS \
- case in_drectve: drectve_section (); break; \
- case in_rdata: rdata_section (); break;
+ case in_drectve: drectve_section (); break;
#define DRECTVE_SECTION_ASM_OP "\t.section .drectve"
-#define RDATA_SECTION_ASM_OP "\t.section .rdata"
+#define READONLY_DATA_SECTION_ASM_OP "\t.section .rdata"
-#define SUBTARGET_EXTRA_SECTIONS in_drectve, in_rdata
+#define SUBTARGET_EXTRA_SECTIONS in_drectve
#define SUBTARGET_EXTRA_SECTION_FUNCTIONS \
- DRECTVE_SECTION_FUNCTION \
- RDATA_SECTION_FUNCTION
+ DRECTVE_SECTION_FUNCTION
#define DRECTVE_SECTION_FUNCTION \
void \
in_section = in_drectve; \
} \
}
-
-#define RDATA_SECTION_FUNCTION \
-void \
-rdata_section () \
-{ \
- if (in_section != in_rdata) \
- { \
- fprintf (asm_out_file, "%s\n", RDATA_SECTION_ASM_OP); \
- in_section = in_rdata; \
- } \
-}
-
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION() rdata_section ()
-
/* 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. Currently, these always
go into the const section. */
#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) rdata_section ()
+#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) readonly_data_section ()
#define MCORE_EXPORT_NAME(STREAM, NAME) \
do \
/* A list of other sections which the compiler might be "in" at any
given time. */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_sdata, in_sbss, in_rdata
+#define EXTRA_SECTIONS in_sdata, in_sbss
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \
- SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP) \
- SECTION_FUNCTION_TEMPLATE(rdata_section, in_rdata, RDATA_SECTION_ASM_OP)
+ SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP)
#define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
void FN () \
/* A list of other sections which the compiler might be "in" at any
given time. */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_sdata, in_rdata
+#define EXTRA_SECTIONS in_sdata
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \
- SECTION_FUNCTION_TEMPLATE(rdata_section, in_rdata, RDATA_SECTION_ASM_OP)
+ SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP)
#define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
void FN () \
/* Definitions of target machine for GNU compiler. Iris version 6.
- Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002
+ Free Software Foundation, Inc.
This file is part of GNU CC.
do_global_* functions instead of running collect2. */
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
-#define CONST_SECTION_ASM_OP_32 "\t.rdata"
-#define CONST_SECTION_ASM_OP_64 "\t.section\t.rodata"
+
+#define READONLY_DATA_SECTION_ASM_OP_32 "\t.rdata"
+#define READONLY_DATA_SECTION_ASM_OP_64 "\t.section\t.rodata"
+#define READONLY_DATA_SECTION_ASM_OP \
+ (mips_abi != ABI_32 && mips_abi != ABI_O64 \
+ ? READONLY_DATA_SECTION_ASM_OP_64 \
+ : READONLY_DATA_SECTION_ASM_OP_32)
/* A default list of other sections which we might be "in" at any given
time. For targets that use additional sections (e.g. .tdesc) you
includes this file. */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_sdata, in_rdata, in_const
+#define EXTRA_SECTIONS in_sdata
/* A default list of extra section function definitions. For targets
that use additional sections (e.g. .tdesc) you should override this
definition in the target-specific file which includes this file. */
-/* ??? rdata_section is now same as svr4 const_section. */
-
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
void \
} \
} \
\
-void \
-rdata_section () \
-{ \
- if (in_section != in_rdata) \
- { \
- if (mips_abi != ABI_32 && mips_abi != ABI_O64) \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP_64); \
- else \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP_32); \
- in_section = in_rdata; \
- } \
-} \
- \
const char * \
current_section_name () \
{ \
case in_data: return ".data"; \
case in_sdata: return ".sdata"; \
case in_bss: return ".bss"; \
- case in_rdata: \
- case in_const: \
+ case in_readonly_data: \
if (mips_abi != ABI_32 && mips_abi != ABI_O64) \
return ".rodata"; \
else \
case in_data: return SECTION_WRITE; \
case in_sdata: return SECTION_WRITE | SECTION_SMALL; \
case in_bss: return SECTION_WRITE | SECTION_BSS; \
- case in_rdata: \
- case in_const: return 0; \
+ case in_readonly_data: return 0; \
case in_named: return get_named_section_flags (in_named_name); \
} \
abort (); \
/* A list of other sections which the compiler might be "in" at any
given time. */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_sdata, in_sbss, in_rdata
+#define EXTRA_SECTIONS in_sdata, in_sbss
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \
- SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP) \
- SECTION_FUNCTION_TEMPLATE(rdata_section, in_rdata, RDATA_SECTION_ASM_OP)
+ SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP)
#define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
void FN () \
{
/* For embedded applications, always put constants in read-only data,
in order to reduce RAM usage. */
- READONLY_DATA_SECTION ();
+ readonly_data_section ();
}
else
{
read-only). */
data_section ();
else
- READONLY_DATA_SECTION ();
+ readonly_data_section ();
}
}
&& (TREE_CODE (decl) != STRING_CST
|| !flag_writable_strings)))
&& ! (flag_pic && reloc))
- READONLY_DATA_SECTION ();
+ readonly_data_section ();
else if (size > 0 && size <= mips_section_threshold)
SMALL_DATA_SECTION ();
else
&& (TREE_CODE (decl) != STRING_CST
|| !flag_writable_strings)))
&& ! (flag_pic && reloc))
- READONLY_DATA_SECTION ();
+ readonly_data_section ();
else
data_section ();
}
extern int mips_string_length; /* length of strings for mips16 */
/* Functions to change what output section we are using. */
-extern void rdata_section PARAMS ((void));
extern void sdata_section PARAMS ((void));
extern void sbss_section PARAMS ((void));
if (TREE_PUBLIC (DECL) && DECL_NAME (DECL)) \
ASM_GLOBALIZE_LABEL (STREAM, NAME); \
\
- READONLY_DATA_SECTION (); \
+ readonly_data_section (); \
ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \
mips_declare_object (STREAM, NAME, "", ":\n\t.space\t%u\n", \
(SIZE)); \
{ \
const char *p = STRING; \
int size = strlen (p) + 1; \
- rdata_section (); \
+ readonly_data_section (); \
assemble_string (p, size); \
}
\f
#define TEXT_SECTION_ASM_OP "\t.text" /* instructions */
#define DATA_SECTION_ASM_OP "\t.data" /* large data */
#define SDATA_SECTION_ASM_OP "\t.sdata" /* small data */
-#define RDATA_SECTION_ASM_OP "\t.rdata" /* read-only data */
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION rdata_section
+#define READONLY_DATA_SECTION_ASM_OP "\t.rdata" /* read-only data */
#define SMALL_DATA_SECTION sdata_section
/* What other sections we support other than the normal .data/.text. */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_sdata, in_rdata
+#define EXTRA_SECTIONS in_sdata
/* Define the additional functions to select our additional sections. */
fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
in_section = in_sdata; \
} \
-} \
- \
-void \
-rdata_section () \
-{ \
- if (in_section != in_rdata) \
- { \
- fprintf (asm_out_file, "%s\n", RDATA_SECTION_ASM_OP); \
- in_section = in_rdata; \
- } \
}
/* Given a decl node or constant node, choose the section to output it in
-D__rtems__ -Asystem=rtems"
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_sdata, in_rdata
+#define EXTRA_SECTIONS in_sdata
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \
- SECTION_FUNCTION_TEMPLATE(rdata_section, in_rdata, RDATA_SECTION_ASM_OP)
+ SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP)
#undef STARTFILE_SPEC
#undef ENDFILE_SPEC
Boston, MA 02111-1307, USA. */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_sdata, in_rdata, in_sbss
+#define EXTRA_SECTIONS in_sdata, in_sbss
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \
- SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP) \
- SECTION_FUNCTION_TEMPLATE(rdata_section, in_rdata, RDATA_SECTION_ASM_OP)
+ SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP)
#undef STARTFILE_SPEC
#undef ENDFILE_SPEC
#define DATA_SECTION_ASM_OP \
mmix_data_section_asm_op ()
-/* Stuff copied from elfos.h. */
-#define EXTRA_SECTIONS in_const
-
-#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION
-
-#define READONLY_DATA_SECTION() const_section ()
-
-#define CONST_SECTION_ASM_OP "\t.section\t.rodata"
-
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
+#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata"
#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) const_section ()
+#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) readonly_data_section ()
#define ENCODE_SECTION_INFO(DECL, FIRST) \
mmix_encode_section_info (DECL, FIRST)
#undef HAS_INIT_SECTION
#undef INIT_SECTION_ASM_OP
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION const_section
-
-#undef CONST_SECTION_ASM_OP
-#define CONST_SECTION_ASM_OP ".section\t.rodata"
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP ".section\t.rodata"
#undef CTORS_SECTION_ASM_OP
#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"x\""
#undef DTORS_SECTION_ASM_OP
#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"x\""
-
-/* A list of other sections which the compiler might be "in" at any
- given time. */
-
-#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const
-
-/* A list of extra section function definitions. */
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION
-
-#undef CONST_SECTION_FUNCTION
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
} \
}
-#undef READONLY_DATA_SECTION
#define READONLY_DATA_SECTION const_section
#undef TARGET_ASM_SELECT_SECTION
would like to simply include svr4.h instead of copying all these
definitions. */
-/* Support const sections and the ctors and dtors sections for g++.
- Note that there appears to be two different ways to support const
- sections at the moment. You can either #define the symbol
- READONLY_DATA_SECTION (giving it some code which switches to the
- readonly data section) or else you can #define the symbols
- EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
- SELECT_RTX_SECTION. We do both here just to be on the safe side. */
-
-#define USE_CONST_SECTION 1
-
-#define CONST_SECTION_ASM_OP "\t.section\t.rodata"
+#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata"
/* On svr4, we *do* have support for the .init and .fini sections, and we
can put stuff in there to be executed before and after `main'. We let
%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}"
#endif
-/* A default list of other sections which we might be "in" at any given
- time. For targets that use additional sections (e.g. .tdesc) you
- should override this definition in the target-specific file which
- includes this file. */
-
-#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const
-
-/* A default list of extra section function definitions. For targets
- that use additional sections (e.g. .tdesc) you should override this
- definition in the target-specific file which includes this file. */
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION
-
-
-#define READONLY_DATA_SECTION() const_section ()
-
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (!USE_CONST_SECTION) \
- text_section(); \
- else if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
-
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
/* Supposedly the assembler rejects the command if there is no tab! */
#define READONLY_DATA_ASM_OP "\t.SPACE $TEXT$\n\t.SUBSPA $LIT$\n"
-#define READONLY_DATA_SECTION readonly_data
+#define EXTRA_SECTIONS in_readonly_data
+
+#define EXTRA_SECTION_FUNCTIONS \
+extern void readonly_data PARAMS ((void)); \
+void \
+readonly_data () \
+{ \
+ if (in_section != in_readonly_data) \
+ { \
+ in_section = in_readonly_data; \
+ fprintf (asm_out_file, "%s\n", READONLY_DATA_ASM_OP); \
+ } \
+}
+
+/* FIXME: HPUX ld generates incorrect GOT entries for "T" fixups
+ which reference data within the $TEXT$ space (for example constant
+ strings in the $LIT$ subspace).
+
+ The assemblers (GAS and HP as) both have problems with handling
+ the difference of two symbols which is the other correct way to
+ reference constant data during PIC code generation.
+
+ So, there's no way to reference constant data which is in the
+ $TEXT$ space during PIC generation. Instead place all constant
+ data into the $PRIVATE$ subspace (this reduces sharing, but it
+ works correctly). */
+
+#define READONLY_DATA_SECTION (flag_pic ? data_section : readonly_data)
/* Output before writable data. */
So, we force exception information into the data section. */
#define TARGET_ASM_EXCEPTION_SECTION data_section
-/* Define the .bss section for ASM_OUTPUT_LOCAL to use. */
-
-#define EXTRA_SECTIONS in_readonly_data
-
-/* FIXME: HPUX ld generates incorrect GOT entries for "T" fixups
- which reference data within the $TEXT$ space (for example constant
- strings in the $LIT$ subspace).
-
- The assemblers (GAS and HP as) both have problems with handling
- the difference of two symbols which is the other correct way to
- reference constant data during PIC code generation.
-
- So, there's no way to reference constant data which is in the
- $TEXT$ space during PIC generation. Instead place all constant
- data into the $PRIVATE$ subspace (this reduces sharing, but it
- works correctly). */
-
-#define EXTRA_SECTION_FUNCTIONS \
-extern void readonly_data PARAMS ((void)); \
-void \
-readonly_data () \
-{ \
- if (in_section != in_readonly_data) \
- { \
- if (flag_pic) \
- fprintf (asm_out_file, "%s\n", DATA_SECTION_ASM_OP); \
- else \
- fprintf (asm_out_file, "%s\n", READONLY_DATA_ASM_OP); \
- in_section = in_readonly_data; \
- } \
-}
-
/* This is how to output a command to make the user-level label named NAME
defined for reference from other files.
#undef ASM_FILE_START
#undef EXTRA_SECTIONS
#undef READONLY_DATA_SECTION
+#undef READONLY_DATA_SECTION_ASM_OP
#undef EXTRA_SECTION_FUNCTIONS
#undef SELECT_RTX_SECTION
#undef TARGET_ASM_SELECT_SECTION
|| GET_CODE (x) == CONST))
data_section ();
else
- const_section ();
+ readonly_data_section ();
}
/* A C statement or statements to switch to the appropriate
int needs_sdata;
int readonly;
static void (* const sec_funcs[4]) PARAMS ((void)) = {
- &const_section,
+ &readonly_data_section,
&sdata2_section,
&data_section,
&sdata_section
/* Besides the usual ELF sections, we need a toc section. */
/* Override elfos.h definition. */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
+#define EXTRA_SECTIONS in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
/* Override elfos.h definition. */
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
TOC_SECTION_FUNCTION \
SDATA_SECTION_FUNCTION \
SDATA2_SECTION_FUNCTION \
/* Definitions of target machine for GNU compiler, for SPARClite w/o FPU, COFF.
- Copyright (C) 1994, 1996, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1996, 2000, 2002 Free Software Foundation, Inc.
Written by Ken Raeburn (raeburn@cygnus.com).
This file is part of GNU CC.
#undef INIT_SECTION_ASM_OP
-/* A list of other sections which the compiler might be "in" at any
- given time. */
-
-#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const
-
-/* A list of extra section function definitions. */
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION
-
#undef DO_GLOBAL_CTORS_BODY
#undef DO_GLOBAL_DTORS_BODY
/* Target definitions for GNU compiler for Sparc running System V.4
- Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998, 2000
+ Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998, 2000, 2002
Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com).
#undef INIT_SECTION_ASM_OP
#undef FINI_SECTION_ASM_OP
-#undef CONST_SECTION_ASM_OP
+#undef READONLY_DATA_SECTION_ASM_OP
#undef TYPE_OPERAND_FMT
#undef PUSHSECTION_FORMAT
#undef STRING_ASM_OP
/* Must use data section for relocatable constants when pic. */
#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \
-{ \
- if (flag_pic && symbolic_operand ((RTX), (MODE))) \
- data_section (); \
- else \
- const_section (); \
+#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \
+{ \
+ if (flag_pic && symbolic_operand ((RTX), (MODE))) \
+ data_section (); \
+ else \
+ readonly_data_section (); \
}
/* Define the names of various pseudo-op used by the Sparc/svr4 assembler.
#define TEXT_SECTION_ASM_OP "\t.section\t\".text\""
#define DATA_SECTION_ASM_OP "\t.section\t\".data\""
#define BSS_SECTION_ASM_OP "\t.section\t\".bss\""
-#define CONST_SECTION_ASM_OP "\t.section\t\".rodata\""
+#define READONLY_DATA_SECTION_ASM_OP "\t.section\t\".rodata\""
#define INIT_SECTION_ASM_OP "\t.section\t\".init\""
#define FINI_SECTION_ASM_OP "\t.section\t\".fini\""
Defined in svr4.h. */
/* #define EXTRA_SECTION_FUNCTIONS */
-/* On most machines, read-only variables, constants, and jump tables are placed
- in the text section. If this is not the case on your machine, this macro
- should be defined to be the name of a function (either `data_section' or a
- function defined in `EXTRA_SECTIONS') that switches to the section to be
- used for read-only items.
-
- If these items should be placed in the text section, this macro should not
- be defined. */
-/* #define READONLY_DATA_SECTION */
-
/* A C statement or statements to switch to the appropriate section for output
of RTX in mode MODE. You can assume that RTX is some kind of constant in
RTL. The argument MODE is redundant except in the case of a `const_int'
Define TARGET_ASM_CONSTRUCTOR to push the address of the constructor. */
-#define USE_CONST_SECTION 0
-
#define INIT_SECTION_ASM_OP "\t.section\t.init"
#define FINI_SECTION_ASM_OP "\t.section .fini,\"x\""
-#define CONST_SECTION_ASM_OP "\t.section\t.rodata, \"x\""
#define DTORS_SECTION_ASM_OP FINI_SECTION_ASM_OP
/* CTOR_LIST_BEGIN and CTOR_LIST_END are machine-dependent
#endif /* STACK_GROWS_DOWNWARD */
-/* Add extra sections .rodata, .init and .fini. */
-
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_init, in_fini
+#define EXTRA_SECTIONS in_init, in_fini
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
- CONST_SECTION_FUNCTION \
INIT_SECTION_FUNCTION \
FINI_SECTION_FUNCTION
} \
}
-#define READONLY_DATA_SECTION() const_section ()
-
-#define CONST_SECTION_FUNCTION \
-void \
-const_section () \
-{ \
- if (!USE_CONST_SECTION) \
- text_section(); \
- else if (in_section != in_const) \
- { \
- fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
- in_section = in_const; \
- } \
-}
-
/* 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
go into the const section. */
#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) const_section()
+#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) readonly_data_section()
default:
if (is_const)
- const_section ();
+ readonly_data_section ();
else
data_section ();
break;
else if (TREE_CODE (exp) == STRING_CST)
{
if (! flag_writable_strings)
- const_section ();
+ readonly_data_section ();
else
data_section ();
}
else
- const_section ();
+ readonly_data_section ();
}
`in_text' and `in_data'. You need not define this macro on a
system with no other sections (that GCC needs to use). */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_tdata, in_sdata, in_zdata, in_const, \
+#define EXTRA_SECTIONS in_tdata, in_sdata, in_zdata, \
in_rozdata, in_rosdata, in_sbss, in_zbss, in_zcommon, in_scommon
/* One or more functions to be defined in `varasm.c'. These
/* This could be done a lot more cleanly using ANSI C ... */
#define EXTRA_SECTION_FUNCTIONS \
-CONST_SECTION_FUNCTION \
- \
void \
sdata_section () \
{ \
#define DATA_SECTION_ASM_OP "\t.data"
-/* Read-only data goes in the data section because
- AT&T's assembler doesn't guarantee the proper alignment
- of data in the text section even if an align statement
- is used. */
+/* Read-only data goes in the data section because AT&T's assembler
+ doesn't guarantee the proper alignment of data in the text section
+ even if an align statement is used. */
-#define READONLY_DATA_SECTION() data_section()
+#define READONLY_DATA_SECTION data_section
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */
assembler operation to identify the following data as writable initialized
data. Normally @code{"\t.data"} is right.
+@findex READONLY_DATA_SECTION_ASM_OP
+@item READONLY_DATA_SECTION_ASM_OP
+A C expression whose value is a string, including spacing, containing the
+assembler operation to identify the following data as read-only initialized
+data.
+
+@findex READONLY_DATA_SECTION
+@item READONLY_DATA_SECTION
+A macro naming a function to call to switch to the proper section for
+read-only data. The default is to use @code{READONLY_DATA_SECTION_ASM_OP}
+if defined, else fall back to @code{text_section}.
+
+The most common definition will be @code{data_section}, if the target
+does not have a special read-only data section, and does not put data
+in the text section.
+
@findex SHARED_SECTION_ASM_OP
@item SHARED_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
@code{data_section}, for your additional sections. Do not define this
macro if you do not define @code{EXTRA_SECTIONS}.
-@findex READONLY_DATA_SECTION
-@item READONLY_DATA_SECTION
-On most machines, read-only variables, constants, and jump tables are
-placed in the text section. If this is not the case on your machine,
-this macro should be defined to be the name of a function (either
-@code{data_section} or a function defined in @code{EXTRA_SECTIONS}) that
-switches to the section to be used for read-only items.
-
-If these items should be placed in the text section, this macro should
-not be defined.
-
@findex SELECT_RTX_SECTION
@item SELECT_RTX_SECTION (@var{mode}, @var{rtx}, @var{align})
A C statement or statements to switch to the appropriate section for
#define JUMP_TABLES_IN_TEXT_SECTION 0
#endif
+#if defined(READONLY_DATA_SECTION) || defined(READONLY_DATA_SECTION_ASM_OP)
+#define HAVE_READONLY_DATA_SECTION 1
+#else
+#define HAVE_READONLY_DATA_SECTION 0
+#endif
+
/* Last insn processed by final_scan_insn. */
static rtx debug_insn;
rtx current_output_insn;
next = NEXT_INSN (insn);
/* ADDR_VECs only take room if read-only data goes into the text
section. */
- if (JUMP_TABLES_IN_TEXT_SECTION
-#if !defined(READONLY_DATA_SECTION)
- || 1
-#endif
- )
+ if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION)
if (next && GET_CODE (next) == JUMP_INSN)
{
rtx nextbody = PATTERN (next);
{
/* This only takes room if read-only data goes into the text
section. */
- if (JUMP_TABLES_IN_TEXT_SECTION
-#if !defined(READONLY_DATA_SECTION)
- || 1
-#endif
- )
+ if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION)
insn_lengths[uid] = (XVECLEN (body,
GET_CODE (body) == ADDR_DIFF_VEC)
* GET_MODE_SIZE (GET_MODE (body)));
PUT_MODE (body, CASE_VECTOR_SHORTEN_MODE (min_addr - rel_addr,
max_addr - rel_addr,
body));
- if (JUMP_TABLES_IN_TEXT_SECTION
-#if !defined(READONLY_DATA_SECTION)
- || 1
-#endif
- )
+ if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION)
{
insn_lengths[uid]
= (XVECLEN (body, 1) * GET_MODE_SIZE (GET_MODE (body)));
#ifdef DTORS_SECTION_ASM_OP
, in_dtors
#endif
+#ifdef READONLY_DATA_SECTION_ASM_OP
+ , in_readonly_data
+#endif
#ifdef EXTRA_SECTIONS
, EXTRA_SECTIONS
#endif
{
if (in_section != in_text)
{
+ in_section = in_text;
#ifdef TEXT_SECTION
TEXT_SECTION ();
#else
fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
#endif
- in_section = in_text;
}
}
{
if (in_section != in_data)
{
+ in_section = in_data;
if (flag_shared_data)
{
#ifdef SHARED_SECTION_ASM_OP
}
else
fprintf (asm_out_file, "%s\n", DATA_SECTION_ASM_OP);
-
- in_section = in_data;
}
}
#ifdef READONLY_DATA_SECTION
READONLY_DATA_SECTION (); /* Note this can call data_section. */
#else
+#ifdef READONLY_DATA_SECTION_ASM_OP
+ if (in_section != in_readonly_data)
+ {
+ in_section = in_readonly_data;
+ fputs (READONLY_DATA_SECTION_ASM_OP, asm_out_file);
+ fputc ('\n', asm_out_file);
+ }
+#else
text_section ();
#endif
+#endif
}
/* Determine if we're in the text section. */