gcc/gcc/config/elfos.h

498 lines
17 KiB
C
Raw Normal View History

/* elfos.h -- operating system specific defines to be used when
targeting GCC for some generic ELF system
Copyright (C) 1991, 1994, 1995, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Based on svr4.h contributed by Ron Guilmette (rfg@netcom.com).
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define TARGET_OBJFMT_CPP_BUILTINS() \
do \
{ \
builtin_define ("__ELF__"); \
} \
while (0)
/* Define a symbol indicating that we are using elfos.h.
Some CPU specific configuration files use this. */
#define USING_ELFOS_H
/* The prefix to add to user-visible assembler symbols.
For ELF systems the convention is *not* to prepend a leading
underscore onto user-level symbol names. */
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX ""
/* Biggest alignment supported by the object file format of this
machine. Use this macro to limit the alignment which can be
specified using the `__attribute__ ((aligned (N)))' construct. If
not defined, the default value is `BIGGEST_ALIGNMENT'. */
#ifndef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT (32768 * 8)
#endif
/* Use periods rather than dollar signs in special g++ assembler names. */
#define NO_DOLLAR_IN_LABEL
/* Writing `int' for a bit-field forces int alignment for the structure. */
#ifndef PCC_BITFIELD_TYPE_MATTERS
#define PCC_BITFIELD_TYPE_MATTERS 1
#endif
/* Implicit library calls should use memcpy, not bcopy, etc. */
#define TARGET_MEM_FUNCTIONS
/* Handle #pragma weak and #pragma pack. */
2002-11-26 05:54:50 +01:00
#define HANDLE_SYSV_PRAGMA 1
/* System V Release 4 uses DWARF debugging info. */
#define DWARF_DEBUGGING_INFO 1
/* All ELF targets can support DWARF-2. */
#define DWARF2_DEBUGGING_INFO 1
/* The GNU tools operate better with dwarf2, and it is required by some
psABI's. Since we don't have any native tools to be compatible with,
default to dwarf2. */
#ifndef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
#endif
/* All SVR4 targets use the ELF object file format. */
#define OBJECT_FORMAT_ELF
/* Output #ident as a .ident. */
#define ASM_OUTPUT_IDENT(FILE, NAME) \
fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
#define IDENT_ASM_OP "\t.ident\t"
#undef SET_ASM_OP
#define SET_ASM_OP "\t.set\t"
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
/* Most svr4 assemblers want a .file directive at the beginning of
their input file. */
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* This is how to allocate empty space in some section. The .zero
pseudo-op is used for this on most svr4 assemblers. */
#define SKIP_ASM_OP "\t.zero\t"
#undef ASM_OUTPUT_SKIP
#define ASM_OUTPUT_SKIP(FILE, SIZE) \
Mon May 12 11:32:53 CEST 2003 Jan Hubicka <jh@suse.cz> * expr.h (assemble_static_space): Update prototype. * output.h (assemble_zeros, output_constant): Likewise. * elfos.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): Make it 64bit clean * alpha.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASK_OUTPUT_LOCAL): Make it 64bit clean. * elf.h (ASM_OTUPUT_SKIP): Likewise. * unicosmk.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMM): Likewise. * arm.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * aout.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * unknown-elf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * avr.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * c4x.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP, ASM_OUTPUT_BSS): Expect HOST_WIDE_INT operand. * aout.h (ASM_OTUPUT_SKIP): Likewise. * cris.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise. * darwin.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON): Likewise. * dsp16xx.h (ASM_OTUPUT_SKIP): Likewise. * frv.h (ASM_OTUPUT_SKIP): Likewise. * h8300.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_LOCAL): Likewise. * 370.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Make it 64bit clean. * att.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * bsd.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Make it 64bit clean. * darwin.h (ASM_OUTPUT_SKIP): Make it 64bit clean.. * sco5.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect HOST_WIDE_INT operand * svr3gas.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect HOST_WIDE_INT operand * sysv3.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand * i960.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_ALIGNED_LOCAL): Expect HOST_WIDE_INT operand * ip2k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m32r.h (ASM_OUTPUT_COMMON): Likewise. * 3b1.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * amix.h (ASM_OUTPUT_ALIGNED_LOCAL): Likewise. * crds.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_LOCAL): Likewise. * hp320.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68kelf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68kv4.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * mot3300.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * netbsd-elf.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * sgs.h (ASM_OUTPUT_SKIP): Likewise. * tower-as.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * m88k.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * mcore.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_BSS, ASM_OUTPUT_SKIP): Likewise. * iris.h (ASM_OUTPUT_LOCAL): Likewise. * mips.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * ns32k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Make it 64bit clean. * pa-pro-end.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it 64bit clean. * pa.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL, ASM_OUTPUT_SKIP): Make it 64bit clean. * hpux.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it 64bit clean. * romp.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect HOST_WIDE_INT argument * s390.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT argument. * sh.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect HOST_WIDE_INT argument * sol2.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument * sparc.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): HOST_WIDE_INT argument * svr3.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument * vax.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * vaxv.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * xtensa.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * varasm.c (asm_output_bss, asm_output_aligned_bss, asm_emit_uninitialized, assemble_zeros, assemble_static_space): HOST_WIDE_INT argument From-SVN: r66713
2003-05-12 11:51:36 +02:00
fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
SKIP_ASM_OP, (SIZE))
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
This is suitable for output with `assemble_name'.
For most svr4 systems, the convention is that any symbol which begins
with a period is not put into the linker symbol table by the assembler. */
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
do \
{ \
sprintf (LABEL, "*.%s%u", PREFIX, (unsigned) (NUM)); \
} \
while (0)
/* Output the label which precedes a jumptable. Note that for all svr4
systems where we actually generate jumptables (which is to say every
svr4 target except i386, where we use casesi instead) we put the jump-
tables into the .rodata section and since other stuff could have been
put into the .rodata section prior to any given jumptable, we have to
make sure that the location counter for the .rodata section gets pro-
perly re-aligned prior to the actual beginning of the jump table. */
unicosmk.h (ASM_OUTPUT_DOUBLE, [...]): Fix format specifier warning. * alpha/unicosmk.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Fix format specifier warning. * convex.h (ASM_OUTPUT_BYTE): Likewise. * elfos.h (ALIGN_ASM_OP): Undef before defining. * i386/att.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warning. * i386/bsd.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386/gas.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386-interix.h (gen_stdcall_suffix): Prototype. * i386.h (ASM_OUTPUT_BYTE): Fix format specifier warning. * i386elf.h (ASM_OUTPUT_FLOAT, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_LONG_DOUBLE): Likewise. * i386/interix.c (gen_stdcall_suffix): Const-ify. * i386/next.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warnings. * i386/osfrose.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386/ptx4-i.h (ASM_OUTPUT_FLOAT, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_LONG_DOUBLE): Likewise. * i386/sco5.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386/sequent.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386/sun386.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386/svr3dbx.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * m68k/3b1.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_FLOAT, ASM_GENERATE_INTERNAL_LABEL): Likewise. * m68k/altos3068.h (ASM_OUTPUT_FLOAT_OPERAND): Likewise. * m68k/amix.h (ASM_OUTPUT_ASCII, ASM_GENERATE_INTERNAL_LABEL): Likewise. * m68k/atari.h (ASM_OUTPUT_ASCII, ASM_GENERATE_INTERNAL_LABEL): Likewise. * m68k/crds.h (ASM_OUTPUT_DOUBLE, PRINT_OPERAND): Likewise. * m68k/dpx2.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_BYTE, ASM_OUTPUT_FLOAT_OPERAND): Likewise. * m68k/hp320.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_BYTE): Likewise. * m68k.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_BYTE): Likewise. * m68k/m68kv4.h (ASM_OUTPUT_ASCII): Delete unused variable. * m68k/mot3300.h (ASM_OUTPUT_BYTE): Fix format specifier warning. * m68k/news.h (PRINT_OPERAND): Likewise. * m68k/next.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_FLOAT_OPERAND, ASM_OUTPUT_DOUBLE_OPERAND): Likewise. * m68k/next21.h (ASM_OUTPUT_FLOAT_OPERAND): Likewise. * m68k/plexus.h (ASM_SPEC): Insert space between macro name and definition. * m68k/sgs.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ASCII, ASM_OUTPUT_FLOAT_OPERAND, ASM_OUTPUT_DOUBLE_OPERAND): Fix format specifier warnings. * m68k/sun3.h (ASM_OUTPUT_FLOAT_OPERAND): Likewise. * m68k/tower-as.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_BYTE, PRINT_OPERAND): Likewise. * m88k/m88k.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_BYTE): Likewise. * mips/elf.h (PUT_SDB_SIZE, ASM_DECLARE_OBJECT_NAME): Likewise. * mips/elf64.h (PUT_SDB_SIZE, ASM_DECLARE_OBJECT_NAME): Likewise. * mips/iris5gas.h (PUT_SDB_SIZE): Likewise. * mips/linux.h (ASM_DECLARE_OBJECT_NAME): Likewise. * mips.c (mips_output_external_libcall): Mark parameter with ATTRIBUTE_UNUSED. (mips_asm_file_start): Move variable into the scope where it's used. * mips.h (PUT_SDB_INT_VAL, PUT_SDB_SIZE): Likewise. * mips/netbsd.h (ASM_DECLARE_OBJECT_NAME): Likewise. * mips/sni-gas.h (PUT_SDB_SIZE): Likewise. * ns32k/encore.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * ns32k.c (print_operand): Likewise. * pa.c (print_operand, output_div_insn): Likewise. * pa.h (ASM_OUTPUT_MI_THUNK, ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_BYTE, PRINT_OPERAND_ADDRESS): Likewise. * pa/pa64-hpux.h (UNIQUE_SECTION): Const-ify. * sparc/linux.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warnings. * sparc/linux64.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * sparc/pbd.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. (ASM_OUTPUT_SOURCE_LINE): Don't list macro arguments in undef. * sparc/vxsim.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warnings. * svr3.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * sdbout.c (sdbout_end_epilogue): Mark parameter with ATTRIBUTE_UNUSED. * varasm.c (assemble_global): Likewise. From-SVN: r46922
2001-11-11 06:56:47 +01:00
#undef ALIGN_ASM_OP
#define ALIGN_ASM_OP "\t.align\t"
#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
ASM_OUTPUT_ALIGN ((FILE), 2);
#endif
#undef ASM_OUTPUT_CASE_LABEL
#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
do \
{ \
ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
(*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \
} \
while (0)
/* The standard SVR4 assembler seems to require that certain builtin
library routines (e.g. .udiv) be explicitly declared as .globl
in each assembly file where they are referenced. */
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk. * alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk. * alpha/elf.h (ASM_OUTPUT_EXTERNAL_LIBCALL, ASM_OUTPUT_ALIGNED_BSS): Use target hook. * alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS): Likewise. * alpha/unicosmk.h (ASM_GLOBALIZE_LABEL): Delete. * arm/aof.h (ASM_GLOBALIZE_LABEL): Likewise. (GLOBAL_ASM_OP): Define. * arm.c (aof_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for AOF. * arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * c4x.c (c4x_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for c4x. * c4x.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * cris/aout.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. * darwin-protos.h (darwin_globalize_label): Declare. * darwin.c (darwin_globalize_label): New function. * darwin.h (ASM_DECLARE_CLASS_REFERENCE): Use target hook. (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP, TARGET_ASM_GLOBALIZE_LABEL): Define. * dsp16xx.c (asm_output_common): Use target hook. * elfos.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise. * frv.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * i370.c (i370_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for i370. * i370.h (ASM_GLOBALIZE_LABEL): Delete. * i386.c (ix86_asm_file_end): Use target hook. * i386/sco5.h (ASM_GLOBALIZE_LABEL): Don't undef. (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. * ia64.c (ia64_asm_output_external): Likewise. * ia64/sysv4.h: Update comment. * m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. * mips/iris5.h (ASM_OUTPUT_WEAK_ALIAS): Use target hook. * mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. * mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use target hook. * mmix-protos.h (mmix_asm_globalize_label): Delete. * mmix.c (mmix_asm_globalize_label): Likewise. * mmix.h (ASM_GLOBALIZE_LABEL): Likewise. (GLOBAL_ASM_OP): Define. * ns32k.c (ns32k_globalize_label): New function. * ns32k.h (TARGET_ASM_GLOBALIZE_LABEL): Define for ns32k. (ASM_GLOBALIZE_LABEL): Delete. * pa/pa-linux.h (ASM_GLOBALIZE_LABEL): Don't undef. (TARGET_ASM_GLOBALIZE_LABEL): Undefine. * pa.c (pa_globalize_label): New function. * pa.h (ASM_GLOBALIZE_LABEL): Delete. (TARGET_ASM_GLOBALIZE_LABEL): Define for pa. * rs6000/darwin.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. (TARGET_ASM_GLOBALIZE_LABEL): Undef. * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * rs6000/xcoff.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * v850.c (v850_output_aligned_bss): Use target hook. * vax.c (vms_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for vms. * vax/vms.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * defaults.h (ASM_GLOBALIZE_LABEL): Delete. * doc/tm.texi: Update docs. * dwarf2out.c (default_eh_frame_section, output_die_symbol): Use target hook. * final.c (output_alternate_entry_point): Likewise. * hooks.c (hook_FILEptr_constcharptr_void): New function. * hooks.h (hook_FILEptr_constcharptr_void): Declare. * output.h (assemble_global): Delete. (default_globalize_label): Declare. * system.h (ASM_GLOBALIZE_LABEL): Poison. * target-def.h (TARGET_ASM_GLOBALIZE_LABEL): Define. (TARGET_ASM_OUT): Add TARGET_ASM_GLOBALIZE_LABEL. * target.h (gcc_target): Add globalize_label member. * varasm.c (asm_output_bss, asm_output_aligned_bss, globalize_decl): Use target hook. (assemble_global): Delete. (default_globalize_label): New function. From-SVN: r56478
2002-08-21 04:41:51 +02:00
(*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0))
/* This says how to output assembler code to declare an
uninitialized external linkage data object. Under SVR4,
the linker seems to want the alignment of data objects
to depend on their types. We do exactly that here. */
#define COMMON_ASM_OP "\t.comm\t"
#undef ASM_OUTPUT_ALIGNED_COMMON
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
do \
{ \
fprintf ((FILE), "%s", COMMON_ASM_OP); \
assemble_name ((FILE), (NAME)); \
Mon May 12 11:32:53 CEST 2003 Jan Hubicka <jh@suse.cz> * expr.h (assemble_static_space): Update prototype. * output.h (assemble_zeros, output_constant): Likewise. * elfos.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): Make it 64bit clean * alpha.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASK_OUTPUT_LOCAL): Make it 64bit clean. * elf.h (ASM_OTUPUT_SKIP): Likewise. * unicosmk.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMM): Likewise. * arm.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * aout.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * unknown-elf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * avr.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * c4x.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP, ASM_OUTPUT_BSS): Expect HOST_WIDE_INT operand. * aout.h (ASM_OTUPUT_SKIP): Likewise. * cris.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise. * darwin.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON): Likewise. * dsp16xx.h (ASM_OTUPUT_SKIP): Likewise. * frv.h (ASM_OTUPUT_SKIP): Likewise. * h8300.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_LOCAL): Likewise. * 370.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Make it 64bit clean. * att.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. * bsd.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Make it 64bit clean. * darwin.h (ASM_OUTPUT_SKIP): Make it 64bit clean.. * sco5.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect HOST_WIDE_INT operand * svr3gas.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect HOST_WIDE_INT operand * sysv3.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand * i960.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_ALIGNED_LOCAL): Expect HOST_WIDE_INT operand * ip2k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m32r.h (ASM_OUTPUT_COMMON): Likewise. * 3b1.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * amix.h (ASM_OUTPUT_ALIGNED_LOCAL): Likewise. * crds.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_LOCAL): Likewise. * hp320.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68kelf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * m68kv4.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * mot3300.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * netbsd-elf.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * sgs.h (ASM_OUTPUT_SKIP): Likewise. * tower-as.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * m88k.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Likewise. * mcore.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_BSS, ASM_OUTPUT_SKIP): Likewise. * iris.h (ASM_OUTPUT_LOCAL): Likewise. * mips.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. * ns32k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Make it 64bit clean. * pa-pro-end.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it 64bit clean. * pa.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL, ASM_OUTPUT_SKIP): Make it 64bit clean. * hpux.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it 64bit clean. * romp.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect HOST_WIDE_INT argument * s390.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT argument. * sh.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect HOST_WIDE_INT argument * sol2.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument * sparc.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): HOST_WIDE_INT argument * svr3.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument * vax.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * vaxv.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * xtensa.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument * varasm.c (asm_output_bss, asm_output_aligned_bss, asm_emit_uninitialized, assemble_zeros, assemble_static_space): HOST_WIDE_INT argument From-SVN: r66713
2003-05-12 11:51:36 +02:00
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
(SIZE), (ALIGN) / BITS_PER_UNIT); \
} \
while (0)
/* This says how to output assembler code to declare an
uninitialized internal linkage data object. Under SVR4,
the linker seems to want the alignment of data objects
to depend on their types. We do exactly that here. */
#define LOCAL_ASM_OP "\t.local\t"
#undef ASM_OUTPUT_ALIGNED_LOCAL
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
do \
{ \
fprintf ((FILE), "%s", LOCAL_ASM_OP); \
assemble_name ((FILE), (NAME)); \
fprintf ((FILE), "\n"); \
ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
} \
while (0)
/* This is the pseudo-op used to generate a contiguous sequence of byte
values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
#undef ASCII_DATA_ASM_OP
#define ASCII_DATA_ASM_OP "\t.ascii\t"
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
2002-05-18 21:27:52 +02:00
/* 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
crtstuff.c and other files know this by defining the following symbols.
The definitions say how to change sections to the .init and .fini
sections. This is the same for all known svr4 assemblers. */
#define INIT_SECTION_ASM_OP "\t.section\t.init"
#define FINI_SECTION_ASM_OP "\t.section\t.fini"
configure.in: Check whether assembler supports section merging. * configure.in: Check whether assembler supports section merging. * config.in: Rebuilt. * configure: Rebuilt. * varasm.c (variable_section, output_constant_pool): Pass alignment to SELECT_SECTION and SELECT_RTX_SECTION. (mergeable_string_section): New. (mergeable_constant_section): New. (default_elf_asm_named_section): Output SECTION_MERGE and SECTION_STRINGS flags plus SECTION_ENTSIZE entity size. * output.h (mergeable_string_section): New. (mergeable_constant_section): New. (SECTION_MERGE, SECTION_STRINGS, SECTION_ENTSIZE): Define. * toplev.c (flag_merge_constants): New. (f_options): Add -fmerge-constants and -fmerge-all-constants options. (toplev_main): Default to -fno-merge-constants if not optimizing. * flags.h (flag_merge_constants): Add extern. * invoke.texi (-fmerge-constants, -fmerge-all-constants): Document. * tm.texi (SELECT_SECTION, SELECT_RTX_SECTION): Document added third argument. * config/elfos.h (ASM_SECTION_START_OP, ASM_OUTPUT_SECTION_START): Define if assembler has working .subsection -1 support. (SELECT_RTX_SECTION, SELECT_SECTION): Add third macro argument. Put constant into special SHF_MERGE sections if the linker should attempt to merge duplicates. * config/ia64/sysv4.h (SELECT_RTX_SECTION, SELECT_SECTION): Add third macro argument. Put constant into special SHF_MERGE sections if the linker should attempt to merge duplicates. * config/alpha/elf.h: Likewise. (ASM_SECTION_START_OP, ASM_OUTPUT_SECTION_START): Define if assembler has working .subsection -1 support. * config/nextstep.h: Add third argument to SELECT_RTX_SECTION and SELECT_SECTION. * config/svr3.h: Likewise. * config/darwin.h: Likewise. * config/arm/aof.h: Likewise. * config/arm/linux-elf.h: Likewise. * config/avr/avr.h: Likewise. * config/c4x/c4x.h: Likewise. * config/d30v/d30v.h: Likewise. * config/i386/dgux.h: Likewise. * config/i386/osfrose.h: Likewise. * config/i386/sco5.h: Likewise. * config/i386/svr3gas.h: Likewise. * config/ia64/aix.h: Likewise. * config/m32r/m32r.h: Likewise. * config/m68k/m68k.h: Likewise. * config/m88k/dgux.h: Likewise. * config/m88k/m88k.h: Likewise. * config/mcore/mcore-pe.h: Likewise. * config/mips/mips.h: Likewise. * config/pa/pa.h: Likewise. * config/pa/pa-linux.h: Likewise. * config/romp/romp.h: Likewise. * config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h: Likewise. * config/s390/linux.h: Likewise. * config/sparc/sparc.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/stormy16/stormy16.h: Likewise. * config/v850/v850.h: Likewise. * config/vax/vms.h: Likewise. * config/arm/arm.c (arm_elf_asm_named_section): Output SECTION_MERGE and SECTION_STRINGS flags plus SECTION_ENTSIZE entity size. * config/sparc/sparc.c (sparc_elf_asm_named_section): Use default_elf_asm_named_section for SHF_MERGE sections. * com.c (ffe_init_options): Default to -fmerge-all-constants if optimizing. From-SVN: r45548
2001-09-11 18:50:05 +02:00
/* Output assembly directive to move to the beginning of current section. */
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
2002-05-18 21:27:52 +02:00
#ifdef HAVE_GAS_SUBSECTION_ORDERING
# define ASM_SECTION_START_OP "\t.subsection\t-1"
# define ASM_OUTPUT_SECTION_START(FILE) \
configure.in: Check whether assembler supports section merging. * configure.in: Check whether assembler supports section merging. * config.in: Rebuilt. * configure: Rebuilt. * varasm.c (variable_section, output_constant_pool): Pass alignment to SELECT_SECTION and SELECT_RTX_SECTION. (mergeable_string_section): New. (mergeable_constant_section): New. (default_elf_asm_named_section): Output SECTION_MERGE and SECTION_STRINGS flags plus SECTION_ENTSIZE entity size. * output.h (mergeable_string_section): New. (mergeable_constant_section): New. (SECTION_MERGE, SECTION_STRINGS, SECTION_ENTSIZE): Define. * toplev.c (flag_merge_constants): New. (f_options): Add -fmerge-constants and -fmerge-all-constants options. (toplev_main): Default to -fno-merge-constants if not optimizing. * flags.h (flag_merge_constants): Add extern. * invoke.texi (-fmerge-constants, -fmerge-all-constants): Document. * tm.texi (SELECT_SECTION, SELECT_RTX_SECTION): Document added third argument. * config/elfos.h (ASM_SECTION_START_OP, ASM_OUTPUT_SECTION_START): Define if assembler has working .subsection -1 support. (SELECT_RTX_SECTION, SELECT_SECTION): Add third macro argument. Put constant into special SHF_MERGE sections if the linker should attempt to merge duplicates. * config/ia64/sysv4.h (SELECT_RTX_SECTION, SELECT_SECTION): Add third macro argument. Put constant into special SHF_MERGE sections if the linker should attempt to merge duplicates. * config/alpha/elf.h: Likewise. (ASM_SECTION_START_OP, ASM_OUTPUT_SECTION_START): Define if assembler has working .subsection -1 support. * config/nextstep.h: Add third argument to SELECT_RTX_SECTION and SELECT_SECTION. * config/svr3.h: Likewise. * config/darwin.h: Likewise. * config/arm/aof.h: Likewise. * config/arm/linux-elf.h: Likewise. * config/avr/avr.h: Likewise. * config/c4x/c4x.h: Likewise. * config/d30v/d30v.h: Likewise. * config/i386/dgux.h: Likewise. * config/i386/osfrose.h: Likewise. * config/i386/sco5.h: Likewise. * config/i386/svr3gas.h: Likewise. * config/ia64/aix.h: Likewise. * config/m32r/m32r.h: Likewise. * config/m68k/m68k.h: Likewise. * config/m88k/dgux.h: Likewise. * config/m88k/m88k.h: Likewise. * config/mcore/mcore-pe.h: Likewise. * config/mips/mips.h: Likewise. * config/pa/pa.h: Likewise. * config/pa/pa-linux.h: Likewise. * config/romp/romp.h: Likewise. * config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h: Likewise. * config/s390/linux.h: Likewise. * config/sparc/sparc.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/stormy16/stormy16.h: Likewise. * config/v850/v850.h: Likewise. * config/vax/vms.h: Likewise. * config/arm/arm.c (arm_elf_asm_named_section): Output SECTION_MERGE and SECTION_STRINGS flags plus SECTION_ENTSIZE entity size. * config/sparc/sparc.c (sparc_elf_asm_named_section): Use default_elf_asm_named_section for SHF_MERGE sections. * com.c (ffe_init_options): Default to -fmerge-all-constants if optimizing. From-SVN: r45548
2001-09-11 18:50:05 +02:00
fprintf ((FILE), "%s\n", ASM_SECTION_START_OP)
#endif
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target-def.h (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. * Makefile.in (toplev.o): Depend on TARGET_H. (varasm.o, dbxout.o): Likewise. * c-common.c (decl_attributes): Check targetm.have_named_sections instead of ifdef ASM_OUTPUT_SECTION_NAME. * dbxout.c (dbxout_function_decl): Likewise. (dbxout_function_end): Likewise. * toplev.c (compile_file): Likewise. * varasm.c (exception_section): Likewise. * cp/decl2.c (finish_objects): Likewise. * defaults.h (EH_FRAME_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. (UNIQUE_SECTION_P): Remove. * dwarf2out.c (SECTION_FORMAT): Remove. (ASM_OUTPUT_SECTION): Remove. (output_call_frame_info): Use named_section_flags. (output_comp_unit, dwarf2out_start_source_file): Likewise. (dwarf2out_end_source_file, dwarf2out_define): Likewise. (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. * varasm.c (in_eh_frame, eh_frame_section): Remove. (named_section_flags): New. (named_section): Use it and targetm.section_type_flags. (resolve_unique_section): New. (assemble_start_function): Use it. (asm_emit_uninitialised, assemble_variable): Likewise. (default_section_type_flags): New. (default_no_named_section, default_elf_asm_named_section): New. (default_coff_asm_named_section, default_pe_asm_named_section): New. * output.h: Update varasm.c decls. (SECTION_*): New flags. * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. * config/elfos.h (UNIQUE_SECTION_P): Remove. * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/win32.h: Likewise. * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. * config/mips/elf.h, config/mips/elf64.h: Likewise. * config/mips/iris6gld.h, config/mips/mips.h: Likewise. * config/pa/pa64-hpux.h, * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. * config/alpha/vms.h, config/arm/coff.h: Likewise. * config/arm/conix-elf.h, config/arm/elf.h: Likewise. * config/arm/linux-elf.h, config/arm/pe.h: Likewise. * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. * config/i386/sco5.h, config/i386/win32.h: Likewise. * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. * config/mcore/mcore.h, config/mips/elf.h: Likewise. * config/mips/elf64.h, config/mips/iris6.h: Likewise. * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/nextstep.h: Error until named sections implemented. * config/a29k/a29k.c (a29k_asm_named_section): New. * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. (vms_section_type_flags, vms_asm_named_section): New. * config/arm/arm.c (arm_elf_asm_named_section): New. * config/avr/avr.c (asm_output_section_name): Remove. * config/avr/avr-protos.h: Update. * config/c4x/c4x.c (c4x_asm_named_section): New. * config/h8300/h8300.c (h8300_asm_named_section): New. * config/i386/i386.c (sco_asm_named_section): New. * config/i386/winnt.c (SECTION_PE_SHARED): New. (i386_pe_section_type_flags): New. (i386_pe_asm_named_section): New. * config/i386/i386-protos.h: Update. * config/m68k/m68k.c (m68k_coff_asm_named_section): New. * config/mcore/mcore.c (mcore_asm_named_section): New. * config/mips/mips.c (iris6_asm_named_section): New. * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY instead of UNIQUE_SECTION_P. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. (xcoff_asm_named_section): New. * config/sh/sh.c (sh_asm_named_section): New. * config/sparc/sparc.c (sparc_elf_asm_named_section): New. * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. (EH_FRAME_SECTION_NAME): New. (EXCEPTION_SECTION): New. * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. (DEBUG_*_SECTION): Remove. * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/mips/iris6.h (DEBUG_*_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. * doc/tm.texi (UNIQUE_SECTION_P): Remove. (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. From-SVN: r44623
2001-08-04 03:31:41 +02:00
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
system.h (SELECT_RTX_SECTION): Poison. * system.h (SELECT_RTX_SECTION): Poison. * target-def.h (TARGET_ASM_SELECT_RTX_SECTION): New. * target.h (select_rtx_section): New. * varasm.c (output_constant_pool): Use it. (default_select_rtx_section, default_elf_select_rtx_section): New. * output.h: Declare them. * config/darwin.h (SELECT_RTX_SECTION): Move ... * config/darwin.c (machopic_select_rtx_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (SELECT_RTX_SECTION): Move ... * config/nextstep.c (machopic_select_rtx_section): ... here. (nextstep_select_section): Rename variable to avoid macro clash. * config/nextstep-protos.h: Update. * config/elfos.h, config/svr3.h, config/arm/aof.h, config/c4x/c4x.h, config/i386/dgux.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/paragon.h, config/ia64/aix.h, config/m32r/m32r.h, config/m68k/dpx2.h, config/m68k/lynx.h, config/m68k/m68k.h, config/m68k/tower-as.h, config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mips/mips.h, config/mmix/mmix.h, config/pa/pa-linux.h, config/pa/pa.h, config/romp/romp.h, config/rs6000/lynx.h, config/rs6000/sysv4.h, config/s390/linux.h, config/sparc/sysv4.h, config/xtensa/elf.h, config/xtensa/linux.h (SELECT_RTX_SECTION): Remove. * config/darwin.h, config/elfos.h, config/nextstep.h, config/ia64/aix.h, config/ia64/sysv4.h, config/alpha/alpha.c, config/mips/mips.c, config/romp/romp.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/s390.c, config/sparc/aout.h, config/sparc/lynx.h, config/xtensa/xtensa.c (TARGET_ASM_SELECT_RTX_SECTION): New. * config/alpha/elf.h (SELECT_RTX_SECTION): Move ... * config/alpha/alpha.c (alpha_elf_select_rtx_section): ... here. * config/ia64/sysv4.h (SELECT_RTX_SECTION): Move ... * config/ia64/ia64.c (ia64_select_rtx_section): ... here. (ia64_aix_select_rtx_section): New. * config/mips/iris6.h (READONLY_DATA_SECTION_ASM_OP): Undef before redefining. * config/mips/mips.c (mips_select_rtx_section): Make static. Support ELF SHF_MERGE features. * config/mips/mips-protos.h: Update. * config/rs6000/xcoff.h (SELECT_RTX_SECTION): Move ... * config/rs6000/rs6000.c (rs6000_xcoff_select_rtx_section): ... here. (rs6000_elf_select_rtx_section): Rename from rs6000_select_rtx_section; make static, fall back to default_elf_select_rtx_section. * config/rs6000/rs6000-protos.h: Update. * config/sparc/sparc.h (SELECT_RTX_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_rtx_section): ... here. * config/sparc/sunos4.h (on_exit): Declare only if IN_LIBGCC2. * config/romp/romp.c (romp_select_rtx_section): New. * config/s390/s390.c (s390_select_rtx_section): New. * config/xtensa/xtensa.c: Include output.h. Shuffle local function declarations before target macro definition. (xtensa_emit_call): Use static buffer. (xtensa_select_rtx_section): New. * config/xtensa/xtensa.h (MAX_INT_TYPE_SIZE): Remove. (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR): Remove. (ASM_OUTPUT_POOL_PROLOGUE): Update call to resolve_unique_section. * doc/tm.texi (TARGET_ASM_SELECT_RTX_SECTION): Update from SELECT_RTX_SECTION docs. From-SVN: r53600
2002-05-19 01:47:22 +02:00
#undef TARGET_ASM_SELECT_RTX_SECTION
#define TARGET_ASM_SELECT_RTX_SECTION default_elf_select_rtx_section
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
2002-05-17 09:43:41 +02:00
#undef TARGET_ASM_SELECT_SECTION
#define TARGET_ASM_SELECT_SECTION default_elf_select_section
/* Define the strings used for the special svr4 .type and .size directives.
These strings generally do not vary from one system running svr4 to
another, but if a given system (e.g. m88k running svr) needs to use
different pseudo-op names for these, they may be overridden in the
file which includes this one. */
#define TYPE_ASM_OP "\t.type\t"
#define SIZE_ASM_OP "\t.size\t"
/* This is how we tell the assembler that a symbol is weak. */
#define ASM_WEAKEN_LABEL(FILE, NAME) \
do \
{ \
fputs ("\t.weak\t", (FILE)); \
assemble_name ((FILE), (NAME)); \
fputc ('\n', (FILE)); \
} \
while (0)
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
expect various different forms for this operand. The one given here
is just a default. You may need to override it in your machine-
specific tm.h file (depending upon the particulars of your assembler). */
#define TYPE_OPERAND_FMT "@%s"
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
#ifndef ASM_DECLARE_RESULT
#define ASM_DECLARE_RESULT(FILE, RESULT)
#endif
/* These macros generate the special .type and .size directives which
are used to set the corresponding fields of the linker symbol table
entries in an ELF object file under SVR4. These macros also output
the starting labels for the relevant functions/objects. */
/* Write the extra assembler code needed to declare a function properly.
Some svr4 assemblers need to also have something extra said about the
function's return value. We allow for that here. */
#ifndef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
do \
{ \
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
ASM_OUTPUT_LABEL (FILE, NAME); \
} \
while (0)
#endif
/* Write the extra assembler code needed to declare an object properly. */
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
do \
{ \
HOST_WIDE_INT size; \
\
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
\
size_directive_output = 0; \
if (!flag_inhibit_size_directive \
&& (DECL) && DECL_SIZE (DECL)) \
{ \
size_directive_output = 1; \
size = int_size_in_bytes (TREE_TYPE (DECL)); \
ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
} \
\
ASM_OUTPUT_LABEL (FILE, NAME); \
} \
while (0)
/* Output the size directive for a decl in rest_of_decl_compilation
in the case where we did not do so before the initializer.
Once we find the error_mark_node, we know that the value of
size_directive_output was set
by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
#undef ASM_FINISH_DECLARE_OBJECT
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)\
do \
{ \
const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
HOST_WIDE_INT size; \
\
if (!flag_inhibit_size_directive \
&& DECL_SIZE (DECL) \
&& ! AT_END && TOP_LEVEL \
&& DECL_INITIAL (DECL) == error_mark_node \
&& !size_directive_output) \
{ \
size_directive_output = 1; \
size = int_size_in_bytes (TREE_TYPE (DECL)); \
ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
} \
} \
while (0)
/* This is how to declare the size of a function. */
#ifndef ASM_DECLARE_FUNCTION_SIZE
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
do \
{ \
if (!flag_inhibit_size_directive) \
ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
} \
while (0)
#endif
/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
corresponds to a particular byte value [0..255]. For any
given byte value, if the value in the corresponding table
position is zero, the given character can be output directly.
If the table value is 1, the byte must be output as a \ooo
octal escape. If the tables value is anything else, then the
byte value should be output as a \ followed by the value
in the table. Note that we can use standard UN*X escape
sequences for many control characters, but we don't use
\a to represent BEL because some svr4 assemblers (e.g. on
the i386) don't know about that. Also, we don't use \v
since some versions of gas, such as 2.2 did not accept it. */
#define ESCAPES \
"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
/* Some svr4 assemblers have a limit on the number of characters which
can appear in the operand of a .string directive. If your assembler
has such a limitation, you should define STRING_LIMIT to reflect that
limit. Note that at least some svr4 assemblers have a limit on the
actual number of bytes in the double-quoted string, and that they
count each character in an escape sequence as one byte. Thus, an
escape sequence like \377 would count as four bytes.
If your target assembler doesn't support the .string directive, you
should define this to zero.
*/
#define STRING_LIMIT ((unsigned) 256)
#define STRING_ASM_OP "\t.string\t"
/* The routine used to output NUL terminated strings. We use a special
version of this for most svr4 targets because doing so makes the
generated assembly code more compact (and thus faster to assemble)
as well as more readable, especially for targets like the i386
(where the only alternative is to output character sequences as
comma separated lists of numbers). */
#define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
do \
{ \
register const unsigned char *_limited_str = \
(const unsigned char *) (STR); \
register unsigned ch; \
\
fprintf ((FILE), "%s\"", STRING_ASM_OP); \
\
for (; (ch = *_limited_str); _limited_str++) \
{ \
register int escape; \
\
switch (escape = ESCAPES[ch]) \
{ \
case 0: \
putc (ch, (FILE)); \
break; \
case 1: \
fprintf ((FILE), "\\%03o", ch); \
break; \
default: \
putc ('\\', (FILE)); \
putc (escape, (FILE)); \
break; \
} \
} \
\
fprintf ((FILE), "\"\n"); \
} \
while (0)
/* The routine used to output sequences of byte values. We use a special
version of this for most svr4 targets because doing so makes the
generated assembly code more compact (and thus faster to assemble)
as well as more readable. Note that if we find subparts of the
character sequence which end with NUL (and which are shorter than
STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
do \
{ \
register const unsigned char *_ascii_bytes = \
(const unsigned char *) (STR); \
register const unsigned char *limit = _ascii_bytes + (LENGTH); \
register unsigned bytes_in_chunk = 0; \
\
for (; _ascii_bytes < limit; _ascii_bytes++) \
{ \
register const unsigned char *p; \
\
if (bytes_in_chunk >= 60) \
{ \
fprintf ((FILE), "\"\n"); \
bytes_in_chunk = 0; \
} \
\
for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
continue; \
\
if (p < limit && (p - _ascii_bytes) <= (long)STRING_LIMIT) \
{ \
if (bytes_in_chunk > 0) \
{ \
fprintf ((FILE), "\"\n"); \
bytes_in_chunk = 0; \
} \
\
ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
_ascii_bytes = p; \
} \
else \
{ \
register int escape; \
register unsigned ch; \
\
if (bytes_in_chunk == 0) \
fprintf ((FILE), "%s\"", ASCII_DATA_ASM_OP); \
\
switch (escape = ESCAPES[ch = *_ascii_bytes]) \
{ \
case 0: \
putc (ch, (FILE)); \
bytes_in_chunk++; \
break; \
case 1: \
fprintf ((FILE), "\\%03o", ch); \
bytes_in_chunk += 4; \
break; \
default: \
putc ('\\', (FILE)); \
putc (escape, (FILE)); \
bytes_in_chunk += 2; \
break; \
} \
} \
} \
\
if (bytes_in_chunk > 0) \
fprintf ((FILE), "\"\n"); \
} \
while (0)