]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
final.c (HAVE_READONLY_DATA_SECTION): New.
authorRichard Henderson <rth@redhat.com>
Sat, 18 May 2002 19:27:52 +0000 (12:27 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 18 May 2002 19:27:52 +0000 (12:27 -0700)
* 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.

From-SVN: r53593

70 files changed:
gcc/ChangeLog
gcc/config/1750a/1750a.h
gcc/config/a29k/a29k.h
gcc/config/alpha/alpha-interix.h
gcc/config/alpha/alpha.c
gcc/config/alpha/alpha.h
gcc/config/alpha/elf.h
gcc/config/alpha/unicosmk.h
gcc/config/alpha/vms.h
gcc/config/arc/arc.h
gcc/config/arm/arm.c
gcc/config/arm/coff.h
gcc/config/c4x/c4x.h
gcc/config/d30v/d30v.h
gcc/config/darwin.h
gcc/config/dsp16xx/dsp16xx.h
gcc/config/elfos.h
gcc/config/h8300/elf.h
gcc/config/h8300/h8300.h
gcc/config/i386/aix386ng.h
gcc/config/i386/dgux.h
gcc/config/i386/i386-interix.h
gcc/config/i386/interix.c
gcc/config/i386/osfrose.h
gcc/config/i386/sco5.h
gcc/config/i386/svr3gas.h
gcc/config/i386/winnt.c
gcc/config/i860/paragon.h
gcc/config/i860/sysv3.h
gcc/config/i860/sysv4.h
gcc/config/ia64/aix.h
gcc/config/ia64/hpux.h
gcc/config/ia64/sysv4.h
gcc/config/lynx.h
gcc/config/m32r/m32r.c
gcc/config/m32r/m32r.h
gcc/config/m68k/dpx2.h
gcc/config/m68k/hp320.h
gcc/config/m68k/tower-as.h
gcc/config/m88k/dgux.h
gcc/config/m88k/m88k.c
gcc/config/m88k/m88k.h
gcc/config/mcore/mcore-elf.h
gcc/config/mcore/mcore-pe.h
gcc/config/mips/elf.h
gcc/config/mips/elf64.h
gcc/config/mips/iris6.h
gcc/config/mips/linux.h
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/mips/rtems64.h
gcc/config/mips/vxworks.h
gcc/config/mmix/mmix.h
gcc/config/netware.h
gcc/config/nextstep.h
gcc/config/pa/pa64-hpux.h
gcc/config/pa/som.h
gcc/config/rs6000/lynx.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/sysv4.h
gcc/config/sparc/litecoff.h
gcc/config/sparc/sysv4.h
gcc/config/stormy16/stormy16.h
gcc/config/svr3.h
gcc/config/v850/v850.c
gcc/config/v850/v850.h
gcc/config/we32k/we32k.h
gcc/doc/tm.texi
gcc/final.c
gcc/varasm.c

index 9951dc1a97938954316823d8a1185a8ad4809a71..7deb0653a69b9627c0e865048c9617f213d268ef 100644 (file)
@@ -1,3 +1,89 @@
+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
index ce61f65670f59f086565c2f7eb8d8f4b2ae2abaa..162120ca76ee34042153a1d25ad42bb5b819137c 100644 (file)
@@ -889,16 +889,7 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA
 
 #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;                                     \
     {                                                          \
@@ -920,9 +911,7 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA
        }                                                       \
     }
 
-               
-/* 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"
index 3b8712ee5be93634445088e51e6caad61fab5d5d..1dcd51c969cc27e3f3fc5c6b96204cdad33c3173 100644 (file)
@@ -1333,24 +1333,6 @@ extern const char *a29k_function_name;
 
 #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
index a1c8cfc3ed0153a000ec0eefcee647d248b0fbe3..bb602a56afe224456ded74fc3d4947e947cb9e72 100644 (file)
@@ -69,9 +69,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* 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.
 
@@ -91,38 +89,6 @@ Boston, MA 02111-1307, USA.  */
 #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
index 2fb51a218873b2969fa4178e677014c384c95f63..33a6419a887a09878dfb4f83ad4f680990d8a6af 100644 (file)
@@ -6617,15 +6617,14 @@ alpha_start_function (file, fnname, decl)
     }
 
 #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);
@@ -8256,7 +8255,7 @@ alpha_write_linkage (stream)
 {
   if (alpha_links)
     {
-      readonly_section ();
+      readonly_data_section ();
       fprintf (stream, "\t.align 3\n");
       splay_tree_foreach (alpha_links, alpha_write_one_linkage, stream);
     }
index 6f82d82f13b74e52e7c9274c2e542d431bc29b7f..b890bd63ce6bc21da1a1040d7f318f604e2322d0 100644 (file)
@@ -1724,36 +1724,6 @@ do {                                                                          \
 
 #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).  */
index 55199983aab10856435f8a6315c02c8d4bad37cd..3e8d1e06f9bb765a9cca084c31a8d8d66a62ab22 100644 (file)
@@ -191,14 +191,8 @@ do {                                                                       \
 #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
@@ -233,7 +227,7 @@ do {                                                                        \
    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
@@ -241,30 +235,12 @@ do {                                                                      \
 
 #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 ()                                     \
index 6cf19acf44679241d0b385917ead37b06151fa0c..a8c8915d406f93aa53d0b791e080fa1cdebaf61e 100644 (file)
@@ -347,9 +347,9 @@ do { fprintf (FILE, "\tbr $1,0\n");                 \
 #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
index 53f2fbd707a9a5d92c12dd6c38dfb6b1ee0ac973..06d9c9585765c06a5a2960ea6de52a31ef9b7953 100644 (file)
@@ -263,26 +263,17 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
 }
 
 #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)                                   \
@@ -301,7 +292,6 @@ literals_section ()                                         \
     }                                                          \
 }
 
-extern void readonly_section   PARAMS ((void));
 extern void link_section       PARAMS ((void));
 extern void literals_section   PARAMS ((void));
 
@@ -312,9 +302,6 @@ 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
index bb04f2cf0fa7f02fa4c3ee99bda4028f6a401b0a..d431bd4636f3e85f8dbf7a5d76824325e5ce3ac5 100644 (file)
@@ -1106,12 +1106,12 @@ extern const char *arc_text_section, *arc_data_section, *arc_rodata_section;
 #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"
 
index 05355a129bd6eec35617281933cae1b55f459238..d784050c4b02958c5e18f57f19b6611c7aa4b1bc 100644 (file)
@@ -5342,7 +5342,7 @@ get_jump_table_size (insn)
   /* 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
       )
index c9f0d9277ab2bed33e13e1bc7775cfb456990b70..263e115311f08d4df7652d37844b5526b191c47a 100644 (file)
@@ -1,6 +1,6 @@
 /* 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).
    
@@ -76,42 +76,12 @@ Boston, MA 02111-1307, USA.  */
    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++.  */
 
index 04dbe52c6822d0dea2b3fd7266f74c09c54a4452..ed2b4cb13c2f432d1fba6a661912ef902fa91750 100644 (file)
@@ -1673,9 +1673,7 @@ if (REG_P (OP1) && ! REG_P (OP0))                 \
 
 #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.  */
@@ -1687,11 +1685,10 @@ if (REG_P (OP1) && ! REG_P (OP0))                       \
 #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
 
@@ -1718,21 +1715,6 @@ fini_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 ASM_STABS_OP "\t.stabs\t"
 
 /* Switch into a generic section.  */
@@ -1759,7 +1741,7 @@ const_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.  */
index f13d90c4e0168aed3cf028759f5d28e64c8fcc70..a0b17e241626e6d4c69318058dfefcadda7afaa7 100644 (file)
@@ -2747,16 +2747,6 @@ extern const char *d30v_branch_cost_string;
    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'
index 19c7a096a080adeed6e54e11f15049fe5778fcbb..9d7c59039f2ecefb4676bb591df02ec08a8c6b35 100644 (file)
@@ -483,7 +483,6 @@ objc_section_init ()                                \
     }                                          \
 }
 
-#undef READONLY_DATA_SECTION
 #define READONLY_DATA_SECTION const_section
 
 #undef TARGET_ASM_SELECT_SECTION
index ec8f2b799aec4d9b10484db41c6e2225f8ec97b6..0848bbd13c7e265d70a56c4ab5d8a1c293a041ba 100644 (file)
@@ -1548,8 +1548,7 @@ extern struct dsp16xx_frame_info current_frame_info;
 
 /* 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"
@@ -1561,22 +1560,6 @@ extern struct dsp16xx_frame_info current_frame_info;
 /* 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 */
 
index ea11b653f5ffb27f123131eaa211955d1d36dd88..3cec99595eadbd5d4ac9aafc6c873034e6c9e0c8 100644 (file)
@@ -216,10 +216,8 @@ Boston, MA 02111-1307, USA.  */
 #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
@@ -230,47 +228,13 @@ Boston, MA 02111-1307, USA.  */
 #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.  */
index 3b6db3b2d38168bfb8bc50d2170f5716a396932f..7aad2a64c8c837c7c93072cb3ff276b1b0ec90d6 100644 (file)
@@ -9,7 +9,7 @@
 #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
index ccf8c461cbcba39d69bd1c351c01c74d9ab85af0..97955a3c32f1870e3ae9bf95d15679bc8cd0bc36 100644 (file)
@@ -1062,35 +1062,12 @@ struct cum_arg
 /* 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                   \
 {                                              \
index d1b936cee0d3d324e3e8ae7cf4bbf5e7e282a349..5905867ac7ae28411d649f1c3963f32198f78eb0 100644 (file)
@@ -92,6 +92,7 @@ Boston, MA 02111-1307, USA.  */
  * 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
@@ -109,18 +110,6 @@ Boston, MA 02111-1307, USA.  */
 # 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) \
index cd344f4b2c2f6114f93ea9df95dc4ab85d984739..998c8c307e4ceb90d8b256090d740e10402eb9b6 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
 
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
 */
 
 #ifndef VERSION_INFO2
-#define VERSION_INFO2   "$Revision: 1.16 $"
+#define VERSION_INFO2   "$Revision: 1.17 $"
 #endif
 
 #ifndef VERSION_STRING
@@ -232,13 +232,13 @@ Boston, MA 02111-1307, USA.  */
 
 /* 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 */
@@ -250,5 +250,5 @@ Boston, MA 02111-1307, USA.  */
     (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"
index 680e0269196b9b1e45d4ec1f24314147dc5202d3..ea37a1cc543ce5244380183a56150b8b2084330c 100644 (file)
@@ -234,41 +234,7 @@ Boston, MA 02111-1307, USA.  */
 
 #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
index 8ea2c6e171f2571e5d1f364bdc03b1288ecd980c..e8caa60e6050a540d9d01a0a0c322bd78d518756 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
 
@@ -93,15 +93,8 @@ i386_pe_unique_section (decl, reloc)
      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);
index 0264575c1712e084330f0b349367e960eb65504f..03aa95a145055528bc5905065500e496987363ab 100644 (file)
@@ -464,42 +464,6 @@ do                                                         \
   }                                                            \
 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.  */
 
index 0fc142763de4b3d5ab6dee9d51959314492aa9e0..90aba9b9c53fce86b016b731fb8064a030abf9cf 100644 (file)
@@ -77,17 +77,13 @@ Boston, MA 02111-1307, USA.  */
 #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"
@@ -354,15 +350,15 @@ do {                                                                      \
 
 /* 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
@@ -458,28 +454,13 @@ do {                                                                      \
   ((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                                                                   \
index 489a0dc6852cd951f9673aa1e7540d93839f9f03..f47a90627ece605bb4692f2b77218497774a5c0e 100644 (file)
@@ -83,13 +83,8 @@ Boston, MA 02111-1307, USA.  */
    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
 
@@ -113,14 +108,11 @@ do {                                                              \
     (*--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
 
@@ -146,21 +138,6 @@ fini_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 TARGET_ASM_CONSTRUCTOR  ix86_svr3_asm_out_constructor
 
 /* A C statement or statements to switch to the appropriate
@@ -169,4 +146,4 @@ const_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()
index 08f144f626bb93f11ffc8acd80ffcf1560cf2cc4..87f3c70849c3606c5a1dd36d2237fcefec6f792f 100644 (file)
@@ -445,15 +445,8 @@ i386_pe_unique_section (decl, reloc)
      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);
index f55b8859fe0974595297765312dc9fe2b416e254..cb2ae642e73d8758943c484122c5dc8d6e2f2c7a 100644 (file)
@@ -176,14 +176,13 @@ Boston, MA 02111-1307, USA.  */
  */
 #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
index cc26176c963383483ce807db35a2eaa8c3812eeb..f361a0108b55e94c405f6a840a50267a55daaa2f 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
@@ -134,6 +134,7 @@ extern const char *current_function_original_name;
   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
@@ -145,11 +146,10 @@ extern const char *current_function_original_name;
 #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                                         \
@@ -162,7 +162,3 @@ tdesc_section ()                                                    \
       in_section = in_tdesc;                                           \
     }                                                                  \
 }
-
-/* Enable the `const' section that svr3.h defines how to use.  */
-#undef USE_CONST_SECTION
-#define USE_CONST_SECTION      1
index 9d5e52f374d10cacc43baeb742d86300f0eac7fe..753807fe123ca3f200a931206530e68eae3528c6 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
@@ -124,11 +124,10 @@ extern const char *current_function_original_name;
 #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                                         \
index 0e66a5dcb0858e582510fc4e8a6314efac60acf8..700950fc3caf2e69da61176e2f6b9c45316a88ec 100644 (file)
@@ -139,15 +139,15 @@ do {                                                      \
 
 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.  */
index d46acf2b6efa5b1c3e6dc195743f920480353635..afc799903179aab976f88f6d0a57d0586b48958e 100644 (file)
@@ -1,5 +1,5 @@
 /* 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>
 
@@ -85,8 +85,9 @@ Boston, MA 02111-1307, USA.  */
 
 #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
index 1f07b8c0f91b2a147ac3e4bd5e8af0224f3999aa..881b23da45307332400d742265e176372f8b2d7a 100644 (file)
@@ -156,11 +156,10 @@ extern unsigned int ia64_section_threshold;
 }
 
 #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
 
index 012a701bc64dd716fefb74a7c6f01af5262f0d85..193935ee2283c91a2d208aeaf998094e10a212e0 100644 (file)
@@ -1,5 +1,6 @@
 /* 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.
 
@@ -128,11 +129,10 @@ do {                                                              \
 #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
index 4851127138fd621ca3ad14f2899d247968cc9570..a1f3c9115e03688da843127a29d4ac793b69bae9 100644 (file)
@@ -331,7 +331,7 @@ m32r_select_section (decl, reloc, align)
   if (TREE_CODE (decl) == STRING_CST)
     {
       if (! flag_writable_strings)
-       const_section ();
+       readonly_data_section ();
       else
        data_section ();
     }
@@ -347,10 +347,10 @@ m32r_select_section (decl, reloc, align)
                   && !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,
index f0b783a7ea8721a1cc231f681b52c9ffb13f511e..c3b00326e29ccaf5ba8a63fa83e4eaadd52f3e57 100644 (file)
@@ -1526,14 +1526,14 @@ do {                                                                    \
 #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
@@ -1541,7 +1541,6 @@ do {                                                                      \
    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
 
index fa6557b43602ed10f6462d42464ea333e86fc9da..3595eebcdecfe573f193ca5e56d885a23c676cd6 100644 (file)
@@ -47,8 +47,7 @@ Boston, MA 02111-1307, USA.  */
 #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
 
index 292d25db5b9e7fb9075ad47c4c884c82a72c9e60..7a18c52256a80ef0136af81c1d65367102774750 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
@@ -164,7 +164,7 @@ Boston, MA 02111-1307, USA.  */
 #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
index 6007099bd3ee308b2a144875616c46a4626079e3..cd457cd1d25bb645451474116d17117091448bd3 100644 (file)
@@ -1,6 +1,7 @@
 /* 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.
 
@@ -543,8 +544,8 @@ do { fprintf (asm_out_file, "\ttag\t");     \
 #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);                   \
index b7d134d4e6abfffd450dc93b3099ba55140072ee..7c12b7c7a47dc8ca0085487d7a5a9dc3e7461efc 100644 (file)
@@ -1,6 +1,6 @@
 /* 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)
@@ -293,10 +293,10 @@ func_ptr __DTOR_END__[1] = { (func_ptr) (-1) }
 
 /* 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 ();                          \
 }
index 6fdcf4b10951615f6b418110021d4aa179f8cd15..8e2c5c0832eb81fad776062faba338b2c64af9e6 100644 (file)
@@ -3329,7 +3329,7 @@ m88k_select_section (decl, reloc, align)
   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
@@ -3346,10 +3346,10 @@ m88k_select_section (decl, reloc, align)
                   && !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
index 17b6b7bbb867a53dd8e1454a10ff97d9aeeb4a15..0edec9faf4fa89b524eb09d4810b172898b371a6 100644 (file)
@@ -1619,7 +1619,7 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
 
 /* 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
@@ -1638,7 +1638,7 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
 #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                      \
@@ -2295,32 +2295,24 @@ do {                                                                     \
    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
 
@@ -2329,8 +2321,6 @@ const_section ()                                                  \
 
 #undef EXTRA_SECTION_FUNCTIONS
 #define EXTRA_SECTION_FUNCTIONS                                                \
-  CONST_SECTION_FUNCTION                                               \
-                                                                       \
 void                                                                   \
 tdesc_section ()                                                       \
 {                                                                      \
index 8cb8d1b337ae5110de75af7c5be6f28436fa95cb..2cdbae01063762701ae5f34101b00beff4f7e6b4 100644 (file)
@@ -42,13 +42,10 @@ Boston, MA 02111-1307, USA.  */
 
 #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                                                           \
@@ -62,8 +59,7 @@ exports_section ()                                            \
 }
 
 #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)                        \
index 5fd3b8d7ddaa5980125c1d79def2ba049a127827..c5e8e45300e957bfe08348f0ddf0ca0eb02b1adf 100644 (file)
@@ -43,17 +43,15 @@ Boston, MA 02111-1307, USA.  */
    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                                                           \
@@ -65,28 +63,13 @@ drectve_section ()                                          \
       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                                                   \
index d3267379bf1efd3d309a88fce9de60b36e76ff1d..de870c09a898b1635b142a4a337e61a3ca7b0a63 100644 (file)
@@ -225,13 +225,12 @@ 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 ()                                                            \
index a162fc41a9f7a1409e2ce1c9bf827d8cfcd33f55..8d6bf4a675249c2641586b6cca9cda5d77935c5b 100644 (file)
@@ -215,12 +215,11 @@ 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_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 ()                                                            \
index 71a18e83a16b3f6bb222597bbda0e311a401ce97..ff03d35aeaae23ca6c97ed1c649d95abea014cb6 100644 (file)
@@ -1,5 +1,6 @@
 /* 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.
 
@@ -249,8 +250,13 @@ Boston, MA 02111-1307, USA.  */
    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
@@ -258,14 +264,12 @@ Boston, MA 02111-1307, USA.  */
    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                                                                   \
@@ -278,19 +282,6 @@ sdata_section ()                                                   \
     }                                                                  \
 }                                                                      \
                                                                        \
-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 ()                                                        \
 {                                                                      \
@@ -301,8 +292,7 @@ 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                                                             \
@@ -323,8 +313,7 @@ current_section_flags ()                                            \
     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 ();                                                            \
index 755a8c002286e1e249bf3b28e8f42bd4437bfd4f..701e896aa12c6dda5ffb38339daf52990ac35760 100644 (file)
@@ -93,13 +93,12 @@ 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 ()                                                     \
index b93e53180d81af5ca68548c252ebaef8cc8cff32..f551d62788983636583d61b79fca49edb27345ad 100644 (file)
@@ -7913,7 +7913,7 @@ mips_select_rtx_section (mode, x)
     {
       /* For embedded applications, always put constants in read-only data,
         in order to reduce RAM usage.  */
-      READONLY_DATA_SECTION ();
+      readonly_data_section ();
     }
   else
     {
@@ -7932,7 +7932,7 @@ mips_select_rtx_section (mode, x)
           read-only).  */
        data_section ();
       else
-       READONLY_DATA_SECTION ();
+       readonly_data_section ();
     }
 }
 
@@ -7979,7 +7979,7 @@ mips_select_section (decl, reloc, align)
               && (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
@@ -8002,7 +8002,7 @@ mips_select_section (decl, reloc, align)
                    && (TREE_CODE (decl) != STRING_CST
                        || !flag_writable_strings)))
               && ! (flag_pic && reloc))
-       READONLY_DATA_SECTION ();
+       readonly_data_section ();
       else
        data_section ();
     }
index dba54e658167160c0f45e82eadfb3c4574dc20cb..3dea475d676f6ca0a9973f8fbd22dad9855ec84a 100644 (file)
@@ -169,7 +169,6 @@ extern struct rtx_def *mips_load_reg4;      /* 4th reg to check for load delay */
 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));
 
@@ -4534,7 +4533,7 @@ while (0)
        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));                                                    \
@@ -4676,7 +4675,7 @@ do {                                                                      \
 {                                                                      \
   const char *p = STRING;                                              \
   int size = strlen (p) + 1;                                           \
-  rdata_section ();                                                    \
+  readonly_data_section ();                                            \
   assemble_string (p, size);                                           \
 }
 \f
@@ -4689,15 +4688,13 @@ do {                                                                    \
 #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.  */
 
@@ -4719,16 +4716,6 @@ sdata_section ()                                                 \
       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
index e3c74ca04eab519d0a5c1457cd6c33743f18eb38..c4e4f4bc13f460b4ba2bb4e6517685d3287697b6 100644 (file)
@@ -26,12 +26,11 @@ Boston, MA 02111-1307, USA.  */
    -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
index 9eca3b71c6a1bca0b5c04c905a51cc8a76d03bb9..67838e201fdc31bd5d6ec69f4f40a3c9963e91dc 100644 (file)
@@ -18,13 +18,12 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
 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
index c603ebb5c1afcd8f322d2dea248d269ce09b2038..fdb60ccbe3dde328e9ecfde0f541519ef8331ea8 100644 (file)
@@ -905,29 +905,10 @@ typedef struct { int regs; int lib; int now_varargs; } CUMULATIVE_ARGS;
 #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)
index dbb247740b15b5a613d5de7e6e0241729a1b3c6b..90e85aac1d5daebb11413197f6b2ddd5b896d115 100644 (file)
@@ -61,36 +61,9 @@ Boston, MA 02111-1307, USA.  */
 #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;                                            \
-    }                                                                   \
-}
index b96e365ac2881615f81d50d3be95c9f620a64efa..1f3c43723269a5b5dd99cfbf1d431a27b5d1cafb 100644 (file)
@@ -439,7 +439,6 @@ objc_section_init ()                                \
     }                                          \
 }
 
-#undef READONLY_DATA_SECTION
 #define READONLY_DATA_SECTION const_section
 
 #undef TARGET_ASM_SELECT_SECTION
index 4469e378dbc060a1c0397a27487c9a6eadd3e9fe..047ca6f8d330647e94b792412b9ad5a0d13e9bff 100644 (file)
@@ -95,17 +95,7 @@ do {  \
    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
@@ -135,38 +125,6 @@ do {  \
                          %{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
 
index f20a5a8d04e75b890f5bb5f3b8360e1ab4623a41..062fff756f700d7d45356d46e3bead3bb7adae41 100644 (file)
@@ -250,7 +250,34 @@ do {  \
 /* 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.  */
 
@@ -268,38 +295,6 @@ do {  \
    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.
 
index 5416abba3ed9cc08e6bf765f7200bea6a8461f34..87058b232eb82a3c44fb2e8dbccbaa75c16b048b 100644 (file)
@@ -27,6 +27,7 @@ Boston, MA 02111-1307, USA.  */
 #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
index e803e2eebb714af312fad7069723900a25fefe61..5bca89be604ef12bee3e5c7ceb7ac73442bfb6bc 100644 (file)
@@ -10952,7 +10952,7 @@ rs6000_select_rtx_section (mode, x)
               || GET_CODE (x) == CONST))
     data_section ();
   else
-    const_section ();
+    readonly_data_section ();
 }
 
 /* A C statement or statements to switch to the appropriate
@@ -10970,7 +10970,7 @@ rs6000_elf_select_section (decl, reloc, align)
   int needs_sdata;
   int readonly;
   static void (* const sec_funcs[4]) PARAMS ((void)) = {
-    &const_section,
+    &readonly_data_section,
     &sdata2_section,
     &data_section,
     &sdata_section
index 2eff24c97621e61657027f0febf739533c27f90b..06a5bf68f3e12866e08967070c6512e0f4647474 100644 (file)
@@ -431,12 +431,11 @@ do {                                                                      \
 /* 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                                              \
index ad0e1225db41fd3004476650ee3b7989740cf6a1..91808f5eda74843f5436c37bde853561ea57bc23 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
@@ -32,18 +32,6 @@ Boston, MA 02111-1307, USA.  */
 
 #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
 
index a4c7f915c2e9985a372c77f2c5e65f8591eeaf7d..a5242bd8dd1b2a440ff3dd82b1ef57b959e102c7 100644 (file)
@@ -1,5 +1,5 @@
 /* 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).
 
@@ -40,7 +40,7 @@ Boston, MA 02111-1307, USA.  */
 
 #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
@@ -70,12 +70,12 @@ Boston, MA 02111-1307, USA.  */
 
 /* 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.
@@ -143,7 +143,7 @@ do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3);            \
 #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\""
 
index 4c49ad8ec6ecf3d650e99b8fd211e1951e69bcb2..9518f5fd002946b849b03aba6e58868691cb9944 100644 (file)
@@ -2535,16 +2535,6 @@ do {                                                     \
    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'
index 5e3ddc948527b3416e454d02059cb86659381460..9a90c6f25a4c5507c5dfb2e0767e79b2d34a6ae1 100644 (file)
@@ -199,11 +199,8 @@ Boston, MA 02111-1307, USA.
 
    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
@@ -234,14 +231,11 @@ do {                                                              \
 
 #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
 
@@ -267,21 +261,6 @@ fini_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;                                           \
-    }                                                                  \
-}
-
 /* 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
@@ -289,4 +268,4 @@ const_section ()                                                    \
    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()
index c47e47b3dcd1a3244cfcbc3efab4a791f9010265..72129d3868d73d11c82b535959f4d85fecf19206 100644 (file)
@@ -2890,7 +2890,7 @@ v850_select_section (exp, reloc, align)
 
         default:
           if (is_const)
-           const_section ();
+           readonly_data_section ();
          else
            data_section ();
          break;
@@ -2899,10 +2899,10 @@ v850_select_section (exp, reloc, align)
   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 ();
 }
index 4f637ff7095ffe0626aac2ce1513575f98ad01d4..becef7cc7bb001171a50ca1e8a7b11562f789231 100644 (file)
@@ -1021,7 +1021,7 @@ typedef enum
    `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
@@ -1032,8 +1032,6 @@ typedef enum
 
 /* This could be done a lot more cleanly using ANSI C ... */
 #define EXTRA_SECTION_FUNCTIONS                                                \
-CONST_SECTION_FUNCTION                                                 \
-                                                                       \
 void                                                                   \
 sdata_section ()                                                       \
 {                                                                      \
index 1bf6805d1e7138cdcb909085bc764b2fdc5ee990..e918ac0cd15fc8b40f6b534963040caae1e6bd51 100644 (file)
@@ -672,12 +672,11 @@ enum reg_class { NO_REGS, GENERAL_REGS,
 
 #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).  */
index f3b379fb896dc32ef408dbdcc711ff512ae6874d..339d83d2be4d5c6603f33b36952ca3490b72827b 100644 (file)
@@ -5668,6 +5668,22 @@ A C expression whose value is a string, including spacing, containing the
 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,
@@ -5741,17 +5757,6 @@ functions should do jobs analogous to those of @code{text_section} and
 @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
index 2eeeb8c39a8c87cb4f0de84d0f4965b89e9643ef..eeed1a1e89281457e0f658e4d4bc878a2c214898 100644 (file)
@@ -99,6 +99,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #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;
@@ -1115,11 +1121,7 @@ shorten_branches (first)
          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);
@@ -1282,11 +1284,7 @@ shorten_branches (first)
        {
          /* 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)));
@@ -1487,11 +1485,7 @@ shorten_branches (first)
              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)));
index 1709233ade06638d8db1e44f74e2ff111a18985d..3fc3af8d8d059f6232c2026f3ad71afc79942a09 100644 (file)
@@ -196,6 +196,9 @@ static enum in_section { no_section, in_text, in_data, in_named
 #ifdef DTORS_SECTION_ASM_OP
   , in_dtors
 #endif
+#ifdef READONLY_DATA_SECTION_ASM_OP
+  , in_readonly_data
+#endif
 #ifdef EXTRA_SECTIONS
   , EXTRA_SECTIONS
 #endif
@@ -234,12 +237,12 @@ text_section ()
 {
   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;
     }
 }
 
@@ -250,6 +253,7 @@ data_section ()
 {
   if (in_section != in_data)
     {
+      in_section = in_data;
       if (flag_shared_data)
        {
 #ifdef SHARED_SECTION_ASM_OP
@@ -260,8 +264,6 @@ data_section ()
        }
       else
        fprintf (asm_out_file, "%s\n", DATA_SECTION_ASM_OP);
-
-      in_section = in_data;
     }
 }
 
@@ -283,9 +285,18 @@ readonly_data_section ()
 {
 #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.  */