OSDN Git Service

* final.c (HAVE_READONLY_DATA_SECTION): New.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 May 2002 19:27:52 +0000 (19:27 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 May 2002 19:27:52 +0000 (19:27 +0000)
(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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53593 138bc75d-0d04-0410-961f-82ee72b054a4

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 9951dc1..7deb065 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 ce61f65..162120c 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 3b8712e..1dcd51c 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 a1c8cfc..bb602a5 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 2fb51a2..33a6419 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 6f82d82..b890bd6 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 5519998..3e8d1e0 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 6cf19ac..a8c8915 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 53f2fbd..06d9c95 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 bb04f2c..d431bd4 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 05355a1..d784050 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 c9f0d92..263e115 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 04dbe52..ed2b4cb 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 f13d90c..a0b17e2 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 19c7a09..9d7c590 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 ec8f2b7..0848bbd 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 ea11b65..3cec995 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 3b6db3b..7aad2a6 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 ccf8c46..97955a3 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 d1b936c..5905867 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 cd344f4..998c8c3 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 680e026..ea37a1c 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 8ea2c6e..e8caa60 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 0264575..03aa95a 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 0fc1427..90aba9b 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 489a0dc..f47a906 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 08f144f..87f3c70 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 f55b885..cb2ae64 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 cc26176..f361a01 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 9d5e52f..753807f 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 0e66a5d..700950f 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 d46acf2..afc7999 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 1f07b8c..881b23d 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 012a701..193935e 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 4851127..a1f3c91 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 f0b783a..c3b0032 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 fa6557b..3595eeb 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 292d25d..7a18c52 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 6007099..cd457cd 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 b7d134d..7c12b7c 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 6fdcf4b..8e2c5c0 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 17b6b7b..0edec9f 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 8cb8d1b..2cdbae0 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 5fd3b8d..c5e8e45 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 d326737..de870c0 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 a162fc4..8d6bf4a 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 71a18e8..ff03d35 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 755a8c0..701e896 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 b93e531..f551d62 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 dba54e6..3dea475 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 e3c74ca..c4e4f4b 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 9eca3b7..67838e2 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 c603ebb..fdb60cc 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 dbb2477..90e85aa 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 b96e365..1f3c437 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 4469e37..047ca6f 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 f20a5a8..062fff7 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 5416abb..87058b2 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 e803e2e..5bca89b 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 2eff24c..06a5bf6 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 ad0e122..91808f5 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 a4c7f91..a5242bd 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 4c49ad8..9518f5f 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 5e3ddc9..9a90c6f 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 c47e47b..72129d3 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 4f637ff..becef7c 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 1bf6805..e918ac0 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 f3b379f..339d83d 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 2eeeb8c..eeed1a1 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 1709233..3fc3af8 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;
     }
 }
 
@@ -284,8 +286,17 @@ 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.  */