aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-05-18 12:27:52 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-05-18 12:27:52 -0700
commitd48bc59acf17cb6141afdba04724b31cbb8f36fd (patch)
tree2dca4d9feb84fe806bc6aea4af3df7eeedd15b0c /gcc/config/pa
parente964a55607b3cd9e45a45d3331c6f163df7519f5 (diff)
downloadgcc-d48bc59acf17cb6141afdba04724b31cbb8f36fd.zip
gcc-d48bc59acf17cb6141afdba04724b31cbb8f36fd.tar.gz
gcc-d48bc59acf17cb6141afdba04724b31cbb8f36fd.tar.bz2
final.c (HAVE_READONLY_DATA_SECTION): New.
* final.c (HAVE_READONLY_DATA_SECTION): New. (shorten_branches): Use it instead of ifdefs. * varasm.c (enum in_section): Add in_readonly_data. (text_section, data_section): Tidy. (readonly_data_section): Use READONLY_DATA_SECTION_ASM_OP if present. * config/darwin.h, config/nextstep.h, config/h8300/elf.h, config/i860/paragon.h, config/m68k/dpx2.h, config/m68k/hp320.h (READONLY_DATA_SECTION): Don't undef. * config/alpha/unicosmk.h, config/h8300/elf.h, config/i386/aix386ng.h, config/i860/paragon.h, config/m68k/dpx2.h, config/m68k/hp320.h, config/rs6000/lynx.h (READONLY_DATA_SECTION_ASM_OP): Undef. * config/elfos.h, config/svr3.h, config/alpha/alpha-interix.h, config/alpha/elf.h, config/c4x/c4x.h, config/i386/i386-interix.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/sysv3.h, config/m88k/m88k.h, config/pa/pa64-hpux.h (USE_CONST_SECTION): Remove. * config/elfos.h, config/netware.h, config/alpha/alpha-interix.h, config/alpha/elf.h, config/alpha/vms.h, config/arc/arc.h, config/arm/coff.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/i386/dgux.h, config/i386/i386-interix.h, config/i386/sco5.h, config/ia64/hpux.h, config/m32r/m32r.h, config/m68k/tower-as.h, config/m88k/m88k.h, config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h, config/mmix/mmix.h, config/pa/pa64-hpux.h, config/sparc/sysv4.h (READONLY_DATA_SECTION_ASM_OP): Rename from CONST_SECTION_ASM_OP/READONLY_SECTION_ASM_OP/RDATA_SECTION_ASM_OP. * config/elfos.h, config/netware.h, config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha-interix.h, config/alpha/alpha.h, config/arm/coff.h, config/h8300/h8300.h, config/i386/aix386ng.h, config/i386/i386-interix.h, config/i386/osfrose.h, config/mmix/mmix.h, config/pa/pa64-hpux.h, config/sparc/litecoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove. * config/elfos.h, config/netware.h, config/svr3.h, config/alpha/alpha-interix.h, config/alpha/alpha.h, config/alpha/elf.h, config/arm/coff.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/h8300/h8300.h, config/i386/i386-interix.h, config/i386/osfrose.h, config/i386/svr3gas.h, config/mmix/mmix.h, config/pa/pa64-hpux.h (READONLY_DATA_SECTION): Remove. * config/elfos.h, config/netware.h, config/svr3.h, config/alpha/alpha-interix.h, config/alpha/alpha.h, config/alpha/elf.h, config/c4x/c4x.h, config/i386/aix386ng.h, config/i386/i386-interix.h, config/i386/sco5.h, config/i386/svr3gas.h, config/mmix/mmix.h, config/pa/pa64-hpux.h (CONST_SECTION_FUNCTION): Remove. * config/lynx.h, config/svr3.h, config/alpha/elf.h, config/alpha/vms.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/sysv3.h, config/i860/sysv4.h, config/ia64/sysv4.h, config/m32r/m32r.h, config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore-pe.h, config/mips/elf.h, config/mips/elf64.h, config/mips/iris6.h, config/mips/linux.h, config/mips/mips.h, config/mips/rtems64.h, config/mips/vxworks.h, config/rs6000/sysv4.h, config/v850/v850.h (EXTRA_SECTIONS): Remove in_const/in_rdata. (EXTRA_SECTION_FUNCTIONS): Remove accompanying function. * config/svr3.h, config/c4x/c4x.h, config/i386/dgux.h, config/i386/sco5.h, config/i386/svr3gas.h, config/ia64/aix.h, config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mmix/mmix.h, config/sparc/sysv4.h (SELECT_RTX_SECTION): Use readonly_data_section. * config/alpha/alpha.c (alpha_start_function): Likewise. (alpha_write_linkage): Likewise. * config/m32r/m32r.c (m32r_select_section): Likewise. * config/m88k/m88k.c (m88k_select_section): Likewise. * config/mips/mips.c (mips_select_rtx_section): Likewise. * config/rs6000/rs6000.c (rs6000_select_rtx_section): Likewise. (rs6000_elf_select_section): Likewise. * config/v850/v850.c (v850_select_section): Likewise. * config/1750a/1750a.h, config/i860/sysv3.h (READONLY_DATA_SECTION_ASM_OP): New. READONLY_DATA_SECTION_ASM_OP. * config/i386/interix.c, config/i386/winnt.c (i386_pe_unique_section): Always use .rdata prefix. * config/pa/som.h (readonly_data): Always switch to read-only section. (READONLY_DATA_SECTION): Predicate on flag_pic. * config/we32k/we32k.h (READONLY_DATA_SECTION): Remove parenthesis. * doc/tm.texi (READONLY_DATA_SECTION_ASM_OP): New. (READONLY_DATA_SECTION): Update. From-SVN: r53593
Diffstat (limited to 'gcc/config/pa')
-rw-r--r--gcc/config/pa/pa64-hpux.h44
-rw-r--r--gcc/config/pa/som.h61
2 files changed, 29 insertions, 76 deletions
diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h
index 4469e37..047ca6f 100644
--- a/gcc/config/pa/pa64-hpux.h
+++ b/gcc/config/pa/pa64-hpux.h
@@ -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
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index f20a5a8..062fff7 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -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.