diff options
author | Richard Henderson <rth@redhat.com> | 2002-05-17 00:43:41 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-05-17 00:43:41 -0700 |
commit | ae46c4e08a8cbb8359203a90e172a78e3263174b (patch) | |
tree | a091fa322b67f7b86562f6228ca9bec436939a5d /gcc/config/mips | |
parent | eaeb23a74961d9e066158d8e597d6ba01f1091b7 (diff) | |
download | gcc-ae46c4e08a8cbb8359203a90e172a78e3263174b.zip gcc-ae46c4e08a8cbb8359203a90e172a78e3263174b.tar.gz gcc-ae46c4e08a8cbb8359203a90e172a78e3263174b.tar.bz2 |
hooks.c (hook_tree_bool_false): New.
* 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.
From-SVN: r53550
Diffstat (limited to 'gcc/config/mips')
-rw-r--r-- | gcc/config/mips/elf.h | 7 | ||||
-rw-r--r-- | gcc/config/mips/elf64.h | 8 | ||||
-rw-r--r-- | gcc/config/mips/iris6gld.h | 42 | ||||
-rw-r--r-- | gcc/config/mips/linux.h | 4 | ||||
-rw-r--r-- | gcc/config/mips/mips-protos.h | 4 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 17 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 6 |
7 files changed, 25 insertions, 63 deletions
diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h index 5add2f1..d326737 100644 --- a/gcc/config/mips/elf.h +++ b/gcc/config/mips/elf.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. MIPS R3000 version with GOFAST floating point library. - Copyright (C) 1994, 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1994, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -219,9 +219,8 @@ do { \ } while (0) #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) -#undef UNIQUE_SECTION -#define UNIQUE_SECTION(DECL,RELOC) \ - mips_unique_section ((DECL), (RELOC)) + +#define TARGET_ASM_UNIQUE_SECTION mips_unique_section /* A list of other sections which the compiler might be "in" at any given time. */ diff --git a/gcc/config/mips/elf64.h b/gcc/config/mips/elf64.h index 1015573..a162fc4 100644 --- a/gcc/config/mips/elf64.h +++ b/gcc/config/mips/elf64.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GNU compiler. MIPS R4000 version with GOFAST floating point library. - Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2002 + Free Software Foundation, Inc. This file is part of GNU CC. @@ -208,9 +209,8 @@ do { \ } while (0) #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) -#undef UNIQUE_SECTION -#define UNIQUE_SECTION(DECL,RELOC) \ - mips_unique_section ((DECL), (RELOC)) + +#define TARGET_ASM_UNIQUE_SECTION mips_unique_section /* A list of other sections which the compiler might be "in" at any given time. */ diff --git a/gcc/config/mips/iris6gld.h b/gcc/config/mips/iris6gld.h index addc0f7..75556a0 100644 --- a/gcc/config/mips/iris6gld.h +++ b/gcc/config/mips/iris6gld.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Iris version 6 with GNU ld. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. Written by Mark Mitchell <mark@codesourcery.com>. This file is part of GNU CC. @@ -49,42 +49,4 @@ Boston, MA 02111-1307, USA. */ /* The GNU linker supports one-only sections. */ #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) -#define UNIQUE_SECTION(DECL, RELOC) \ - do \ - { \ - int len; \ - int sec; \ - const char *name; \ - char *string; \ - const char *prefix; \ - static const char *const prefixes[/*4*/3][2] = \ - { \ - { ".text.", ".gnu.linkonce.t." }, \ - { ".rodata.", ".gnu.linkonce.r." }, \ - { ".data.", ".gnu.linkonce.d." } \ - /* Do not generate unique sections for uninitialised \ - data since we do not have support for this in the \ - linker scripts yet... \ - , { ".bss.", ".gnu.linkonce.b." } */ \ - }; \ - \ - if (TREE_CODE (DECL) == FUNCTION_DECL) \ - sec = 0; \ - /* else if (DECL_INITIAL (DECL) == 0 \ - || DECL_INITIAL (DECL) == error_mark_node) \ - sec = 3; */ \ - else if (DECL_READONLY_SECTION (DECL, RELOC)) \ - sec = 1; \ - else \ - sec = 2; \ - \ - name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \ - prefix = prefixes[sec][DECL_ONE_ONLY(DECL)]; \ - 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 TARGET_ASM_UNIQUE_SECTION mips_unique_section diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h index 7e2b9ea..755a8c0 100644 --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -88,9 +88,7 @@ do { \ mips_declare_object (FILE, NAME, "", ":\n", 0); \ } while (0) -#undef UNIQUE_SECTION -#define UNIQUE_SECTION(DECL,RELOC) \ - mips_unique_section ((DECL), (RELOC)) +#define TARGET_ASM_UNIQUE_SECTION mips_unique_section /* A list of other sections which the compiler might be "in" at any given time. */ diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h index 29854f0..2158a02 100644 --- a/gcc/config/mips/mips-protos.h +++ b/gcc/config/mips/mips-protos.h @@ -1,6 +1,6 @@ /* Prototypes of target machine for GNU compiler. MIPS version. Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2001 Free Software Foundation, Inc. + 1999, 2001, 2002 Free Software Foundation, Inc. Contributed by A. Lichnewsky (lich@inria.inria.fr). Changed by Michael Meissner (meissner@osf.org). 64 bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and @@ -79,8 +79,6 @@ extern int mips_output_external PARAMS ((FILE *, tree, extern tree mips_build_va_list PARAMS ((void)); extern void mips_va_start PARAMS ((int, tree, rtx)); extern struct rtx_def *mips_va_arg PARAMS ((tree, tree)); -extern void mips_select_section PARAMS ((tree, int)); -extern void mips_unique_section PARAMS ((tree, int)); extern void expand_block_move PARAMS ((rtx *)); extern void final_prescan_insn PARAMS ((rtx, rtx *, int)); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 72f3325..b93e531 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -1,6 +1,6 @@ /* Subroutines for insn-output.c for MIPS Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by A. Lichnewsky, lich@inria.inria.fr. Changes by Michael Meissner, meissner@osf.org. 64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and @@ -146,6 +146,11 @@ static int mips_issue_rate PARAMS ((void)); static void mips_init_machine_status PARAMS ((struct function *)); static void mips_free_machine_status PARAMS ((struct function *)); static void mips_mark_machine_status PARAMS ((struct function *)); +static void mips_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT)) + ATTRIBUTE_UNUSED; +static void mips_unique_section PARAMS ((tree, int)) + ATTRIBUTE_UNUSED; + struct machine_function { /* Pseudo-reg holding the address of the current function when @@ -7943,10 +7948,11 @@ mips_select_rtx_section (mode, x) If you need to make a change here, you probably should check ENCODE_SECTION_INFO to see if it needs a similar change. */ -void -mips_select_section (decl, reloc) +static void +mips_select_section (decl, reloc, align) tree decl; int reloc; + unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED; { int size = int_size_in_bytes (TREE_TYPE (decl)); @@ -10145,9 +10151,10 @@ mips_adjust_cost (insn, link, dep, cost) return cost; } -/* Cover function for UNIQUE_SECTION. */ +/* ??? This could be replaced with the default elf version if + TARGET_IS_SMALL_DATA_P is set properly. */ -void +static void mips_unique_section (decl, reloc) tree decl; int reloc; diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index a6467c0..dba54e6 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -4738,10 +4738,8 @@ rdata_section () \ #define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \ mips_select_rtx_section (MODE, RTX) -#undef SELECT_SECTION -#define SELECT_SECTION(DECL, RELOC, ALIGN) \ - mips_select_section (DECL, RELOC) - +#undef TARGET_ASM_SELECT_SECTION +#define TARGET_ASM_SELECT_SECTION mips_select_section /* Store in OUTPUT a string (made with alloca) containing an assembler-name for a local static variable named NAME. |