diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-17 07:43:41 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-17 07:43:41 +0000 |
commit | 5247088939be6a330f9faf74f0dde78f301abb78 (patch) | |
tree | a091fa322b67f7b86562f6228ca9bec436939a5d /gcc/config/pa | |
parent | be17000d9783c1a2222157b2f3f88494e3e62bde (diff) | |
download | gcc-5247088939be6a330f9faf74f0dde78f301abb78.tar.gz |
* hooks.c (hook_tree_bool_false): New.
* hooks.h: Declare it.
* target-def.h (TARGET_ASM_SELECT_SECTION): New.
(TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New.
* target.h (select_section, unique_section): New.
(in_small_data_p): New.
* varasm.c (resolve_unique_section): Use hooks instead of macros.
(variable_section, output_constant_def_contents): Likewise.
(default_select_section, default_unique_section): New.
(categorize_decl_for_section, default_elf_select_section): New.
* output.h: Declare them.
* config/darwin.h (ALIAS_SECTION, try_section_alias): Remove.
(TARGET_ASM_SELECT_SECTION): New.
(SELECT_SECTION): Move ...
* config/darwin.c (machopic_select_section): ... here.
* config/darwin-protos.h: Update.
* config/nextstep.h (TARGET_ASM_SELECT_SECTION): New.
(SELECT_SECTION): Move ...
* config/nextstep.c (nextstep_select_section): ... here.
* config/nextstep-protos.h: Update.
* config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove.
(TARGET_ASM_SELECT_SECTION): New.
* config/svr3.h (SELECT_SECTION): Remove.
* config/alpha/alpha.c (unicosmk_unique_section): Make static.
(TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New.
(TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New.
(alpha_encode_section_info): Use it.
* config/alpha/alpha-protos.h: Update.
* config/alpha/elf.h (DO_SELECT_SECTION): Remove.
(SELECT_SECTION, UNIQUE_SECTION): Remove.
(TARGET_ASM_SELECT_SECTION): New.
* config/alpha/unicosmk.h (UNIQUE_SECTION): Remove.
* config/arm/pe.h (UNIQUE_SECTION): Remove.
(TARGET_ASM_UNIQUE_SECTION): New.
* config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New.
(avr_unique_section): Rename from unique_section; make static.
* config/avr/avr-protos.h: Update.
* config/avr/avr.h (UNIQUE_SECTION): Remove.
* config/c4x/c4x.h (SELECT_SECTION): Remove.
* config/i386/cygwin.h (UNIQUE_SECTION): Remove.
(TARGET_ASM_UNIQUE_SECTION): New.
* config/i386/i386-interix.h: Likewise.
* config/i386/win32.h: Likewise.
* config/i386/djgpp.h (UNIQUE_SECTION): Remove.
* config/i386/i386.c (ix86_asm_file_end): Use target hook not macro.
* config/i386/sco5.h (SELECT_SECTION): Remove.
(TARGET_ASM_SELECT_SECTION): New.
* config/i386/svr3gas.h (SELECT_SECTION): Remove.
* config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION
instead of SELECT_SECTION.
* config/m68k/dpx2.h: Likewise.
* config/rs6000/lynx.h: Likewise.
* config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove.
(TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New.
* config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New.
(ia64_in_small_data_p): New.
(ia64_encode_section_info): Use it. Reorganize overlarge conditional.
(ia64_aix_select_section, ia64_aix_unique_section): New.
* config/ia64/sysv4.h (DO_SELECT_SECTION): Remove.
(SELECT_SECTION, UNIQUE_SECTION): Remove.
* config/m32r/m32r.h (SELECT_SECTION): Remove.
(TARGET_ASM_SELECT_SECTION): New.
* config/m32r/m32r.c (m32r_select_section): Take align argument.
* config/m32r/m32r-protos.h: Update.
* config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New.
(SELECT_SECTION): Move ...
* config/m88k/m88k.c (m88k_select_section): ... here.
* config/mcore/mcore-pe.h (SELECT_SECTION): Remove.
* config/mcore/mcore.h (UNIQUE_SECTION): Remove.
* config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New.
(mcore_unique_section): Make static.
* config/mcore/mcore-protos.h: Update.
* config/mips/elf.h (UNIQUE_SECTION): Remove.
(TARGET_ASM_UNIQUE_SECTION): New.
* config/mips/elf64.h: Likewise.
* config/mips/iris6gld.h: Likewise.
* config/mips/linux.h: Likewise.
* config/mips/mips-protos.h: Update.
* config/mips/mips.c (mips_select_section): Add align argument.
* config/mips/mips.h (SELECT_SECTION): Remove.
(TARGET_ASM_SELECT_SECTION): New.
* config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove.
* config/mmix/mmix.c (mmix_select_section): Remove.
(mmix_unique_section): Remove.
* config/mmix/mmix-protos.h: Update.
* config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New.
(SELECT_SECTION): Move ...
* config/pa/pa.c (pa_select_section): ... here.
* config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove.
* config/rs6000/rs6000.c (rs6000_elf_select_section): Rename
from rs6000_select_section and make static.
(rs6000_elf_unique_section): Similarly.
(rs6000_xcoff_select_section): From xcoff.h.
(rs6000_xcoff_unique_section): Likewise.
* config/rs6000/rs6000-protos.h: Update.
* config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove.
(TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New.
* config/rs6000/xcoff.h: Likewise.
* config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New.
(SELECT_SECTION): Move ...
* config/sparc/sparc.c (sparc_aout_select_section): ... here.
* config/v850/v850.h (SELECT_SECTION): Move ...
* config/v850/v850.c (v850_select_section): ... here.
(TARGET_ASM_SELECT_SECTION): New.
* config/vax/vms.h (SELECT_SECTION): Move ...
* config/vax/vax.c (vms_select_section): ... here.
(TARGET_ASM_SELECT_SECTION): New.
* doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs
for the target hooks.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53550 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/pa')
-rw-r--r-- | gcc/config/pa/pa.c | 29 | ||||
-rw-r--r-- | gcc/config/pa/pa.h | 20 | ||||
-rw-r--r-- | gcc/config/pa/pa64-hpux.h | 30 |
3 files changed, 30 insertions, 49 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 8e93194f653..babf1a86e01 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -114,6 +114,8 @@ static void pa_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); static int pa_adjust_cost PARAMS ((rtx, rtx, rtx, int)); static int pa_adjust_priority PARAMS ((rtx, int)); static int pa_issue_rate PARAMS ((void)); +static void pa_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT)) + ATTRIBUTE_UNUSED; /* Save the operands last given to a compare for use when we generate a scc or bcc insn. */ @@ -7566,3 +7568,30 @@ pa_add_gc_roots () ggc_add_root (&deferred_plabels, 1, sizeof (&deferred_plabels), &mark_deferred_plabels); } + +/* On hpux10, the linker will give an error if we have a reference + in the read-only data section to a symbol defined in a shared + library. Therefore, expressions that might require a reloc can + not be placed in the read-only data section. */ + +static void +pa_select_section (exp, reloc, align) + tree exp; + int reloc; + unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED; +{ + if (TREE_CODE (exp) == VAR_DECL + && TREE_READONLY (exp) + && !TREE_THIS_VOLATILE (exp) + && DECL_INITIAL (exp) + && (DECL_INITIAL (exp) == error_mark_node + || TREE_CONSTANT (DECL_INITIAL (exp))) + && !reloc) + readonly_data_section (); + else if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'c' + && !(TREE_CODE (exp) == STRING_CST && flag_writable_strings) + && !reloc) + readonly_data_section (); + else + data_section (); +} diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index b4f07681957..af19b64d051 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -1503,25 +1503,7 @@ do { \ else \ readonly_data_section (); -/* On hpux10, the linker will give an error if we have a reference - in the read-only data section to a symbol defined in a shared - library. Therefore, expressions that might require a reloc can - not be placed in the read-only data section. */ -#define SELECT_SECTION(EXP,RELOC,ALIGN) \ - if (TREE_CODE (EXP) == VAR_DECL \ - && TREE_READONLY (EXP) \ - && !TREE_THIS_VOLATILE (EXP) \ - && DECL_INITIAL (EXP) \ - && (DECL_INITIAL (EXP) == error_mark_node \ - || TREE_CONSTANT (DECL_INITIAL (EXP))) \ - && !RELOC) \ - readonly_data_section (); \ - else if (TREE_CODE_CLASS (TREE_CODE (EXP)) == 'c' \ - && !(TREE_CODE (EXP) == STRING_CST && flag_writable_strings) \ - && !RELOC) \ - readonly_data_section (); \ - else \ - data_section (); +#define TARGET_ASM_SELECT_SECTION pa_select_section /* Define this macro if references to a symbol must be treated differently depending on something about the variable or diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h index c4a6b27df8b..4469e378dbc 100644 --- a/gcc/config/pa/pa64-hpux.h +++ b/gcc/config/pa/pa64-hpux.h @@ -171,36 +171,6 @@ const_section () \ #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) -#define UNIQUE_SECTION(DECL,RELOC) \ -do { \ - int len; \ - char *string; \ - const char *prefix, \ - *const name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));\ - \ - if (! DECL_ONE_ONLY (DECL)) \ - { \ - prefix = "."; \ - if (TREE_CODE (DECL) == FUNCTION_DECL) \ - prefix = ".text."; \ - else if (DECL_READONLY_SECTION (DECL, RELOC)) \ - prefix = ".rodata."; \ - else \ - prefix = ".data."; \ - } \ - else if (TREE_CODE (DECL) == FUNCTION_DECL) \ - prefix = ".gnu.linkonce.t."; \ - else if (DECL_READONLY_SECTION (DECL, RELOC)) \ - prefix = ".gnu.linkonce.r."; \ - else \ - prefix = ".gnu.linkonce.d."; \ - \ - len = strlen (name) + strlen (prefix); \ - string = alloca (len + 1); \ - sprintf (string, "%s%s", prefix, name); \ - \ - DECL_SECTION_NAME (DECL) = build_string (len, string); \ -} while (0) /* Define the strings used for the special svr4 .type and .size directives. These strings generally do not vary from one system running svr4 to |