summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-19 21:47:26 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-19 21:47:26 +0000
commit92c473b849792cea6027fad87e53ae2096e82c13 (patch)
treedfd0d874fe0ca79570b8c8107638e443f836c8f4
parent65fe5bfb495fd3116d7e8df62cb783d9c2833704 (diff)
downloadgcc-92c473b849792cea6027fad87e53ae2096e82c13.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68229 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog220
-rw-r--r--gcc/config/alpha/alpha-protos.h2
-rw-r--r--gcc/config/alpha/alpha.c94
-rw-r--r--gcc/config/alpha/elf.h21
-rw-r--r--gcc/config/alpha/openbsd.h23
-rw-r--r--gcc/config/alpha/osf.h16
-rw-r--r--gcc/config/alpha/unicosmk.h11
-rw-r--r--gcc/config/alpha/vms.h15
-rw-r--r--gcc/config/arc/arc-protos.h1
-rw-r--r--gcc/config/arc/arc.c11
-rw-r--r--gcc/config/arc/arc.h4
-rw-r--r--gcc/config/arm/aof.h41
-rw-r--r--gcc/config/arm/aout.h18
-rw-r--r--gcc/config/arm/arm.c34
-rw-r--r--gcc/config/arm/coff.h16
-rw-r--r--gcc/config/arm/elf.h16
-rw-r--r--gcc/config/arm/freebsd.h3
-rw-r--r--gcc/config/arm/linux-gas.h4
-rw-r--r--gcc/config/arm/netbsd-elf.h4
-rw-r--r--gcc/config/arm/netbsd.h4
-rw-r--r--gcc/config/arm/pe.h12
-rw-r--r--gcc/config/avr/avr-protos.h1
-rw-r--r--gcc/config/avr/avr.c27
-rw-r--r--gcc/config/avr/avr.h12
-rw-r--r--gcc/config/c4x/c4x.c25
-rw-r--r--gcc/config/c4x/c4x.h29
-rw-r--r--gcc/config/cris/cris.c23
-rw-r--r--gcc/config/cris/cris.h18
-rw-r--r--gcc/config/darwin.h5
-rw-r--r--gcc/config/dsp16xx/dsp16xx-protos.h3
-rw-r--r--gcc/config/dsp16xx/dsp16xx.c49
-rw-r--r--gcc/config/dsp16xx/dsp16xx.h3
-rw-r--r--gcc/config/elfos.h13
-rw-r--r--gcc/config/h8300/elf.h6
-rw-r--r--gcc/config/h8300/h8300-protos.h1
-rw-r--r--gcc/config/h8300/h8300.c29
-rw-r--r--gcc/config/h8300/h8300.h4
-rw-r--r--gcc/config/i370/i370.c9
-rw-r--r--gcc/config/i370/i370.h4
-rw-r--r--gcc/config/i386/att.h9
-rw-r--r--gcc/config/i386/gas.h10
-rw-r--r--gcc/config/i386/i386-interix.h12
-rw-r--r--gcc/config/i386/i386.c16
-rw-r--r--gcc/config/i386/i386.h4
-rw-r--r--gcc/config/i386/linux.h8
-rw-r--r--gcc/config/i386/sco5.h9
-rw-r--r--gcc/config/i386/sysv4.h9
-rw-r--r--gcc/config/i960/i960-coff.h5
-rw-r--r--gcc/config/i960/i960.h4
-rw-r--r--gcc/config/ia64/ia64-protos.h2
-rw-r--r--gcc/config/ia64/ia64.c24
-rw-r--r--gcc/config/ia64/ia64.h5
-rw-r--r--gcc/config/ia64/ia64.md2
-rw-r--r--gcc/config/ia64/sysv4.h20
-rw-r--r--gcc/config/m32r/m32r-protos.h1
-rw-r--r--gcc/config/m32r/m32r.c17
-rw-r--r--gcc/config/m32r/m32r.h4
-rw-r--r--gcc/config/m68hc11/m68hc11-protos.h2
-rw-r--r--gcc/config/m68hc11/m68hc11.c65
-rw-r--r--gcc/config/m68hc11/m68hc11.h11
-rw-r--r--gcc/config/m68k/coff.h4
-rw-r--r--gcc/config/m68k/hp320.h13
-rw-r--r--gcc/config/m68k/m68k.c14
-rw-r--r--gcc/config/m68k/m68k.h5
-rw-r--r--gcc/config/mcore/mcore-pe.h10
-rw-r--r--gcc/config/mips/iris6.h2
-rw-r--r--gcc/config/mips/mips-protos.h2
-rw-r--r--gcc/config/mips/mips.c38
-rw-r--r--gcc/config/mips/mips.h11
-rw-r--r--gcc/config/mmix/mmix-protos.h1
-rw-r--r--gcc/config/mmix/mmix.c19
-rw-r--r--gcc/config/mmix/mmix.h3
-rw-r--r--gcc/config/mn10300/mn10300-protos.h1
-rw-r--r--gcc/config/mn10300/mn10300.c20
-rw-r--r--gcc/config/mn10300/mn10300.h4
-rw-r--r--gcc/config/ns32k/ns32k.c3
-rw-r--r--gcc/config/ns32k/ns32k.h4
-rw-r--r--gcc/config/pa/elf.h15
-rw-r--r--gcc/config/pa/pa-linux.h24
-rw-r--r--gcc/config/pa/pa.c109
-rw-r--r--gcc/config/pa/pa64-hpux.h45
-rw-r--r--gcc/config/pa/som.h24
-rw-r--r--gcc/config/pdp11/pdp11.h14
-rw-r--r--gcc/config/rs6000/aix.h4
-rw-r--r--gcc/config/rs6000/linux64.h11
-rw-r--r--gcc/config/rs6000/lynx.h1
-rw-r--r--gcc/config/rs6000/rs6000-protos.h1
-rw-r--r--gcc/config/rs6000/rs6000.c54
-rw-r--r--gcc/config/rs6000/rs6000.h2
-rw-r--r--gcc/config/rs6000/sysv4.h10
-rw-r--r--gcc/config/rs6000/xcoff.h44
-rw-r--r--gcc/config/sh/elf.h19
-rw-r--r--gcc/config/sh/sh-protos.h1
-rw-r--r--gcc/config/sh/sh.c50
-rw-r--r--gcc/config/sh/sh.h7
-rw-r--r--gcc/config/sparc/sparc.h4
-rw-r--r--gcc/config/svr3.h7
-rw-r--r--gcc/config/v850/v850-protos.h1
-rw-r--r--gcc/config/v850/v850.c12
-rw-r--r--gcc/config/v850/v850.h4
-rw-r--r--gcc/config/vax/vax.c18
-rw-r--r--gcc/config/vax/vax.h13
-rw-r--r--gcc/config/vax/vaxv.h4
-rw-r--r--gcc/doc/tm.texi43
-rw-r--r--gcc/output.h1
-rw-r--r--gcc/system.h2
-rw-r--r--gcc/target-def.h17
-rw-r--r--gcc/target.h15
-rw-r--r--gcc/toplev.c4
-rw-r--r--gcc/varasm.c12
-rw-r--r--gcc/xcoffout.h4
111 files changed, 840 insertions, 980 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 161cbf0a03f..f33760127f1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,151 @@
+2003-06-19 Zack Weinberg <zack@codesourcery.com>
+
+ * 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.
+
2003-06-19 Graeme Peterson <gp@qnx.com>
* gcc.c (target_sysroot_suffix, target_sysroot_hdrs_suffix,
@@ -36,8 +184,8 @@
2003-06-19 Aldy Hernandez <aldyh@redhat.com>
- * expr.c (const_vector_from_tree): Initialize remaining elements
- to 0.
+ * expr.c (const_vector_from_tree): Initialize remaining elements
+ to 0.
2003-06-19 Aldy Hernandez <aldyh@redhat.com>
@@ -96,8 +244,8 @@
2003-06-18 Richard Henderson <rth@redhat.com>
- * config/ia64/unwind-ia64.c (_Unwind_GetCFA): New.
- (_Unwind_FindEnclosingFunction): Implement.
+ * config/ia64/unwind-ia64.c (_Unwind_GetCFA): New.
+ (_Unwind_FindEnclosingFunction): Implement.
2003-06-18 Kazu Hirata <kazu@cs.umass.edu>
@@ -107,7 +255,7 @@
INSN_SCHEDULING is defined.
2003-06-18 Stephen Clarke <stephen.clarke@superh.com>
- J"orn Rennecke <joern.rennecke@superh.com>
+ J"orn Rennecke <joern.rennecke@superh.com>
* bt-load.c: New file.
* Makefile.in (OBJS): Include bt-load.o
@@ -164,17 +312,17 @@
2003-06-18 Nick Clifton <nickc@redhat.com>
* config.gcc: Add an extra_header for ARM targets.
- Support configuring with --with-cpu=iwmmxt.
+ Support configuring with --with-cpu=iwmmxt.
* doc/invoke.texi: Document new value for -mcpu= ARM switch.
- * config/arm/aof.h (REGISTER_NAMES): Add iwmmxt register
+ * config/arm/aof.h (REGISTER_NAMES): Add iwmmxt register
names. Fix formatting.
- * config/arm/aout.h (REGISTER_NAMES): Add iwmmxt register
+ * config/arm/aout.h (REGISTER_NAMES): Add iwmmxt register
names.
- * config/arm/arm-protos.h (arm_emit_vector_const): New
+ * config/arm/arm-protos.h (arm_emit_vector_const): New
prototype.
(arm_output_load_gr): New prototype.
* config/arm/arm.c (extra_reg_names1): Delete.
- (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN, FL_IWMMXT,
+ (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN, FL_IWMMXT,
* arch_is_iwmmxt): Define.
(all_cores, all_architecture): Add entry for iwmmxt.
(arm_override_options): Add support for iwmmxt.
@@ -193,47 +341,47 @@
(add_minipool_backward_ref, add_minipool_offsets,
dump_minipool, push_minipool_fix): Likewise.
(struct builtin_description): New struct.
- (builtin_description): New array of iwmmxt builtin functions.
- (arm_init_iwmmxt_builtins): New function.
- (arm_init_builtins): New function.
- (safe_vector_operand): New function.
- (arm_expand_binop_builtin): New function.
- (arm_expand_unop_builtin): New function.
- (arm_expand_builtin): New function.
- (arm_emit_vector_const): New function.
- (arm_output_load_gr): New function.
- * config/arm/arm.h (TARGET_CPU_iwmmxt, TARGET_IWMMXT,
+ (builtin_description): New array of iwmmxt builtin functions.
+ (arm_init_iwmmxt_builtins): New function.
+ (arm_init_builtins): New function.
+ (safe_vector_operand): New function.
+ (arm_expand_binop_builtin): New function.
+ (arm_expand_unop_builtin): New function.
+ (arm_expand_builtin): New function.
+ (arm_emit_vector_const): New function.
+ (arm_output_load_gr): New function.
+ * config/arm/arm.h (TARGET_CPU_iwmmxt, TARGET_IWMMXT,
TARGET_REALLY_IWMMXT, arm_arch_iwmmxt, IWMMXT_ALIGNMENT,
TYPE_NEEDS_IWMMXT_ALIGNMENT, ADJUST_FIELD_ALIGN,
DATA_ALIGNMENT, LOCAL_ALIGNMENT, VECTOR_MODE_SUPPORTED_P): Define.
- (BIGGEST_ALIGNMENT): Set to 64 if ATPCS support is enabled.
- (CPP_CPU_ARCH_SPEC): Add entries for iwmmxt.
- (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER,
+ (BIGGEST_ALIGNMENT): Set to 64 if ATPCS support is enabled.
+ (CPP_CPU_ARCH_SPEC): Add entries for iwmmxt.
+ (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER,
reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS,
REG_CLASS_FOR_LETTER): Add iwmmxt registers.
- (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Disable iwmmxt
+ (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Disable iwmmxt
registers unless the iwmmxt target is selected.
- (FIRST_IWMMXT_GR_REGNUM, LAST_IWMMXT_GR_REGNUM,
+ (FIRST_IWMMXT_GR_REGNUM, LAST_IWMMXT_GR_REGNUM,
FIRST_IWMMXT_REGNUM, LAST_IWMMXT_REGNUM, IS_IWMMXT_REGNUM,
IS_IWMMXT_GR_REGNUM): Define.
- (FIRST_PSEUDO_REGISTER): Bump to 63.
- (struct machine_function): Add sibcall_blocked field.
- (Struct CUMULATIVE_ARGS): Add iwmmxt_nregs, named_count and
+ (FIRST_PSEUDO_REGISTER): Bump to 63.
+ (struct machine_function): Add sibcall_blocked field.
+ (Struct CUMULATIVE_ARGS): Add iwmmxt_nregs, named_count and
nargs fields.
- (enum arm_builtins): New enum list.
- * config/arm/arm.md (UNSPEC_WSHUFH, UNSPEC_WACC,
+ (enum arm_builtins): New enum list.
+ * config/arm/arm.md (UNSPEC_WSHUFH, UNSPEC_WACC,
UNSPEC_TMOVMSK, UNSPEC_WSAD, UNSPEC_WSADZ, UNSPEC_WMACS,
UNSPEC_WMACU, UNSPEC_WMACSZ, UNSPEC_WMACUZ, UNSPEC_CLRDI,
UNSPEC_WMADDS, UNSPEC_WMADDU): New unspecs.
(VUNSPEC_TMRC, VUNSPEC_TMCR, VUNSPEC_ALIGN8, VUNSPEC_WCMP_EQ,
VUNSPEC_WCMP_GTU, VUNSPEC_WCMP_GT): New vunspecs.
- (movv2si, movv4hi, movv8qi): New expands for vector moves.
- Include iwmmxt.md.
+ (movv2si, movv4hi, movv8qi): New expands for vector moves.
+ Include iwmmxt.md.
* config/arm/t-xscale-elf (MULTILIB_OPITONS): Add iwmmxt
multilib.
- (MULTILIB_DIRNAMES, MULTILIB_REDUNDANT_DIRS): Likewise.
- * config/arm/mmintrin.h: New ARM specific header file.
- * config/arm/iwmmx.md: New iWMMXt specific machine patterns.
+ (MULTILIB_DIRNAMES, MULTILIB_REDUNDANT_DIRS): Likewise.
+ * config/arm/mmintrin.h: New ARM specific header file.
+ * config/arm/iwmmx.md: New iWMMXt specific machine patterns.
2003-06-18 J"orn Rennecke <joern.rennecke@superh.com>
@@ -337,7 +485,7 @@
* config/ns32k/NOTES: Likewise.
2003-06-17 Ranjit Mathew <rmathew@hotmail.com>
- Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/sourcebuild.texi (libgcj Tests): Simplify instructions on how
to run Java runtime tests separately.
diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h
index 9e96d18939b..3a342eb3f84 100644
--- a/gcc/config/alpha/alpha-protos.h
+++ b/gcc/config/alpha/alpha-protos.h
@@ -30,7 +30,6 @@ extern HOST_WIDE_INT alpha_initial_elimination_offset (unsigned int,
unsigned int);
extern int alpha_pv_save_size (void);
extern int alpha_using_fp (void);
-extern void alpha_write_verstamp (FILE *);
extern void alpha_expand_prologue (void);
extern void alpha_expand_epilogue (void);
extern void alpha_output_filename (FILE *, const char *);
@@ -169,7 +168,6 @@ extern void unicosmk_add_extern (const char *);
extern void unicosmk_output_align (FILE *, int);
extern char * unicosmk_text_section (void);
extern char * unicosmk_data_section (void);
-extern void unicosmk_asm_file_start (FILE *);
extern void unicosmk_output_common (FILE *, const char *, int, int);
extern int unicosmk_initial_elimination_offset (int, int);
#endif
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index cb937df34ce..31f03fc9878 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -6780,20 +6780,6 @@ alpha_does_function_need_gp (void)
return 0;
}
-/* Write a version stamp. Don't write anything if we are running as a
- cross-compiler. Otherwise, use the versions in /usr/include/stamp.h. */
-
-#ifdef HAVE_STAMP_H
-#include <stamp.h>
-#endif
-
-void
-alpha_write_verstamp (FILE *file ATTRIBUTE_UNUSED)
-{
-#ifdef MS_STAMP
- fprintf (file, "\t.verstamp %d %d\n", MS_STAMP, LS_STAMP);
-#endif
-}
/* Helper function to set RTX_FRAME_RELATED_P on instructions, including
sequences. */
@@ -8687,6 +8673,36 @@ alpha_reorg (void)
}
}
+#if !TARGET_ABI_UNICOSMK
+
+#ifdef HAVE_STAMP_H
+#include <stamp.h>
+#endif
+
+static void
+alpha_file_start (void)
+{
+ default_file_start ();
+#ifdef MS_STAMP
+ fprintf (file, "\t.verstamp %d %d\n", MS_STAMP, LS_STAMP);
+#endif
+
+ fputs ("\t.set noreorder\n", asm_out_file);
+ fputs ("\t.set volatile\n", asm_out_file);
+ if (!TARGET_ABI_OPEN_VMS)
+ fputs ("\t.set noat\n", asm_out_file);
+ if (TARGET_EXPLICIT_RELOCS)
+ fputs ("\t.set nomacro\n", asm_out_file);
+ if (TARGET_SUPPORT_ARCH | TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX)
+ fprintf (asm_out_file,
+ "\t.arch %s\n",
+ TARGET_CPU_EV6 ? "ev6"
+ : (TARGET_CPU_EV5
+ ? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5")
+ : "ev4"));
+}
+#endif
+
#ifdef OBJECT_FORMAT_ELF
/* Switch to the section to which we should output X. The only thing
@@ -9728,14 +9744,14 @@ unicosmk_output_dex (FILE *file)
/* Output text that to appear at the beginning of an assembler file. */
-void
-unicosmk_asm_file_start (FILE *file)
+static void
+unicosmk_file_start (void)
{
int i;
- fputs ("\t.ident\t", file);
- unicosmk_output_module_name (file);
- fputs ("\n\n", file);
+ fputs ("\t.ident\t", asm_out_file);
+ unicosmk_output_module_name (asm_out_file);
+ fputs ("\n\n", asm_out_file);
/* The Unicos/Mk assembler uses different register names. Instead of trying
to support them, we simply use micro definitions. */
@@ -9746,12 +9762,12 @@ unicosmk_asm_file_start (FILE *file)
register. */
for (i = 0; i < 32; ++i)
- fprintf (file, "$%d <- r%d\n", i, i);
+ fprintf (asm_out_file, "$%d <- r%d\n", i, i);
for (i = 0; i < 32; ++i)
- fprintf (file, "$f%d <- f%d\n", i, i);
+ fprintf (asm_out_file, "$f%d <- f%d\n", i, i);
- putc ('\n', file);
+ putc ('\n', asm_out_file);
/* The .align directive fill unused space with zeroes which does not work
in code sections. We define the macro 'gcc@code@align' which uses nops
@@ -9759,24 +9775,24 @@ unicosmk_asm_file_start (FILE *file)
biggest possible alignment since . refers to the current offset from
the beginning of the section. */
- fputs ("\t.macro gcc@code@align n\n", file);
- fputs ("gcc@n@bytes = 1 << n\n", file);
- fputs ("gcc@here = . % gcc@n@bytes\n", file);
- fputs ("\t.if ne, gcc@here, 0\n", file);
- fputs ("\t.repeat (gcc@n@bytes - gcc@here) / 4\n", file);
- fputs ("\tbis r31,r31,r31\n", file);
- fputs ("\t.endr\n", file);
- fputs ("\t.endif\n", file);
- fputs ("\t.endm gcc@code@align\n\n", file);
+ fputs ("\t.macro gcc@code@align n\n", asm_out_file);
+ fputs ("gcc@n@bytes = 1 << n\n", asm_out_file);
+ fputs ("gcc@here = . % gcc@n@bytes\n", asm_out_file);
+ fputs ("\t.if ne, gcc@here, 0\n", asm_out_file);
+ fputs ("\t.repeat (gcc@n@bytes - gcc@here) / 4\n", asm_out_file);
+ fputs ("\tbis r31,r31,r31\n", asm_out_file);
+ fputs ("\t.endr\n", asm_out_file);
+ fputs ("\t.endif\n", asm_out_file);
+ fputs ("\t.endm gcc@code@align\n\n", asm_out_file);
/* Output extern declarations which should always be visible. */
- unicosmk_output_default_externs (file);
+ unicosmk_output_default_externs (asm_out_file);
/* Open a dummy section. We always need to be inside a section for the
section-switching code to work correctly.
??? This should be a module id or something like that. I still have to
figure out what the rules for those are. */
- fputs ("\n\t.psect\t$SG00000,data\n", file);
+ fputs ("\n\t.psect\t$SG00000,data\n", asm_out_file);
}
/* Output text to appear at the end of an assembler file. This includes all
@@ -9877,6 +9893,18 @@ unicosmk_need_dex (rtx x ATTRIBUTE_UNUSED)
#undef TARGET_ASM_FUNCTION_END_PROLOGUE
#define TARGET_ASM_FUNCTION_END_PROLOGUE alpha_output_function_end_prologue
+#if TARGET_ABI_UNICOSMK
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START unicosmk_file_start
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END unicosmk_file_end
+#else
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START alpha_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+#endif
+
#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST alpha_adjust_cost
#undef TARGET_SCHED_ISSUE_RATE
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
index 986d5edadd5..8fdfc3e9d16 100644
--- a/gcc/config/alpha/elf.h
+++ b/gcc/config/alpha/elf.h
@@ -49,27 +49,6 @@ Boston, MA 02111-1307, USA. */
#undef ASM_SPEC
#define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}"
-/* Output at beginning of assembler file. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- if (write_symbols == DBX_DEBUG) \
- { \
- alpha_write_verstamp (FILE); \
- output_file_directive (FILE, main_input_filename); \
- } \
- fprintf (FILE, "\t.set noat\n"); \
- fprintf (FILE, "\t.set noreorder\n"); \
- if (TARGET_EXPLICIT_RELOCS) \
- fprintf (FILE, "\t.set nomacro\n"); \
- if (TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX) \
- { \
- fprintf (FILE, "\t.arch %s\n", \
- (TARGET_CPU_EV6 ? "ev6" \
- : TARGET_MAX ? "pca56" : "ev56")); \
- } \
-} while (0)
-
#undef IDENT_ASM_OP
#define IDENT_ASM_OP "\t.ident\t"
diff --git a/gcc/config/alpha/openbsd.h b/gcc/config/alpha/openbsd.h
index 0bab68b66f4..f574e8da1f7 100644
--- a/gcc/config/alpha/openbsd.h
+++ b/gcc/config/alpha/openbsd.h
@@ -88,29 +88,6 @@ Boston, MA 02111-1307, USA. */
#define DWARF2_UNWIND_INFO 0
#endif
-/* Assembler format: file framework. */
-
-/* Taken from alpha/osf.h. This used to be common to all alpha
- configurations, but elf has departed from it.
- Check alpha/alpha.h, alpha/osf.h for it when egcs is upgraded. */
-#ifndef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-{ \
- alpha_write_verstamp (FILE); \
- fprintf (FILE, "\t.set noreorder\n"); \
- fprintf (FILE, "\t.set volatile\n"); \
- fprintf (FILE, "\t.set noat\n"); \
- if (TARGET_SUPPORT_ARCH) \
- fprintf (FILE, "\t.arch %s\n", \
- TARGET_CPU_EV6 ? "ev6" \
- : (TARGET_CPU_EV5 \
- ? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
- : "ev4")); \
- \
- ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
-}
-#endif
-
/* Assembler format: label output. */
#define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index 529a9a30288..3d7936ef015 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -84,22 +84,6 @@ Boston, MA 02111-1307, USA. */
#define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"
-#define ASM_FILE_START(FILE) \
-{ \
- alpha_write_verstamp (FILE); \
- fprintf (FILE, "\t.set noreorder\n"); \
- fprintf (FILE, "\t.set volatile\n"); \
- fprintf (FILE, "\t.set noat\n"); \
- if (TARGET_SUPPORT_ARCH) \
- fprintf (FILE, "\t.arch %s\n", \
- TARGET_CPU_EV6 ? "ev6" \
- : (TARGET_CPU_EV5 \
- ? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
- : "ev4")); \
- \
- ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
-}
-
/* Tru64 UNIX V5.1 requires a special as flag. Empty by default. */
#define ASM_OLDAS_SPEC ""
diff --git a/gcc/config/alpha/unicosmk.h b/gcc/config/alpha/unicosmk.h
index a5ed9415708..8b186f6258d 100644
--- a/gcc/config/alpha/unicosmk.h
+++ b/gcc/config/alpha/unicosmk.h
@@ -333,16 +333,7 @@ ssib_section () \
in_section = in_ssib; \
}
-/* This outputs text to go at the start of an assembler file. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) unicosmk_asm_file_start (FILE)
-
-/* This outputs text to go at the end of an assembler file. */
-
-#define TARGET_ASM_FILE_END unicosmk_file_end
-
-/* We take care of that in ASM_FILE_START. */
+/* We take care of this in unicosmk_file_start. */
#undef ASM_OUTPUT_SOURCE_FILENAME
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index fe12fba2304..f02e1992e43 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -242,21 +242,6 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
#undef STACK_CHECK_BUILTIN
#define STACK_CHECK_BUILTIN 0
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-{ \
- alpha_write_verstamp (FILE); \
- fprintf (FILE, "\t.set noreorder\n"); \
- fprintf (FILE, "\t.set volatile\n"); \
- if (TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX) \
- { \
- fprintf (FILE, "\t.arch %s\n", \
- (TARGET_CPU_EV6 ? "ev6" \
- : TARGET_MAX ? "pca56" : "ev56")); \
- } \
- ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
-}
-
#define LINK_SECTION_ASM_OP "\t.link"
#define READONLY_DATA_SECTION_ASM_OP "\t.rdata"
#define LITERALS_SECTION_ASM_OP "\t.literals"
diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h
index 717845eca0d..f5579892e7b 100644
--- a/gcc/config/arc/arc-protos.h
+++ b/gcc/config/arc/arc-protos.h
@@ -66,7 +66,6 @@ extern void arc_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
extern void arc_init PARAMS ((void));
-extern void arc_asm_file_start PARAMS ((FILE *));
extern unsigned int arc_compute_frame_size PARAMS ((int));
extern void arc_save_restore PARAMS ((FILE *, const char *, unsigned int,
unsigned int, const char *));
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 7673f6f4ccc..67e1b739f22 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -94,6 +94,7 @@ static tree arc_handle_interrupt_attribute PARAMS ((tree *, tree, tree, int, boo
static bool arc_assemble_integer PARAMS ((rtx, unsigned int, int));
static void arc_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void arc_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void arc_file_start PARAMS ((void));
static void arc_internal_label PARAMS ((FILE *, const char *, unsigned long));
static bool arc_rtx_costs PARAMS ((rtx, int, int, int *));
static int arc_address_cost PARAMS ((rtx));
@@ -110,6 +111,8 @@ static int arc_address_cost PARAMS ((rtx));
#define TARGET_ASM_FUNCTION_PROLOGUE arc_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE arc_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START arc_file_start
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE arc_attribute_table
#undef TARGET_ASM_INTERNAL_LABEL
@@ -1657,11 +1660,11 @@ arc_initialize_trampoline (tramp, fnaddr, cxt)
/* Set the cpu type and print out other fancy things,
at the top of the file. */
-void
-arc_asm_file_start (file)
- FILE *file;
+static void
+arc_file_start ()
{
- fprintf (file, "\t.cpu %s\n", arc_cpu_string);
+ default_file_start ();
+ fprintf (asm_out_file, "\t.cpu %s\n", arc_cpu_string);
}
/* Print operand X (an rtx) in assembler syntax to file FILE.
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 7bb9231d67b..16d6d7108cf 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1110,10 +1110,6 @@ extern const char *arc_text_section, *arc_data_section, *arc_rodata_section;
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) arc_asm_file_start (FILE)
-
/* A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will
end at the end of the line. */
diff --git a/gcc/config/arm/aof.h b/gcc/config/arm/aof.h
index 39f2cc3857e..2650a0eedd2 100644
--- a/gcc/config/arm/aof.h
+++ b/gcc/config/arm/aof.h
@@ -130,45 +130,6 @@
whole table generation until the end of the function. */
#define JUMP_TABLES_IN_TEXT_SECTION 1
-#ifndef ARM_OS_NAME
-#define ARM_OS_NAME "(generic)"
-#endif
-
-/* For the AOF linker, we need to reference __main to force the standard
- library to get linked in. */
-
-#define ASM_FILE_START(STREAM) \
-{ \
- fprintf ((STREAM), "%s Generated by gcc %s for ARM/%s\n", \
- ASM_COMMENT_START, version_string, ARM_OS_NAME); \
- fprintf ((STREAM), "__r0\tRN\t0\n"); \
- fprintf ((STREAM), "__a1\tRN\t0\n"); \
- fprintf ((STREAM), "__a2\tRN\t1\n"); \
- fprintf ((STREAM), "__a3\tRN\t2\n"); \
- fprintf ((STREAM), "__a4\tRN\t3\n"); \
- fprintf ((STREAM), "__v1\tRN\t4\n"); \
- fprintf ((STREAM), "__v2\tRN\t5\n"); \
- fprintf ((STREAM), "__v3\tRN\t6\n"); \
- fprintf ((STREAM), "__v4\tRN\t7\n"); \
- fprintf ((STREAM), "__v5\tRN\t8\n"); \
- fprintf ((STREAM), "__v6\tRN\t9\n"); \
- fprintf ((STREAM), "__sl\tRN\t10\n"); \
- fprintf ((STREAM), "__fp\tRN\t11\n"); \
- fprintf ((STREAM), "__ip\tRN\t12\n"); \
- fprintf ((STREAM), "__sp\tRN\t13\n"); \
- fprintf ((STREAM), "__lr\tRN\t14\n"); \
- fprintf ((STREAM), "__pc\tRN\t15\n"); \
- fprintf ((STREAM), "__f0\tFN\t0\n"); \
- fprintf ((STREAM), "__f1\tFN\t1\n"); \
- fprintf ((STREAM), "__f2\tFN\t2\n"); \
- fprintf ((STREAM), "__f3\tFN\t3\n"); \
- fprintf ((STREAM), "__f4\tFN\t4\n"); \
- fprintf ((STREAM), "__f5\tFN\t5\n"); \
- fprintf ((STREAM), "__f6\tFN\t6\n"); \
- fprintf ((STREAM), "__f7\tFN\t7\n"); \
- text_section (); \
-}
-
/* Some systems use __main in a way incompatible with its use in gcc, in these
cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
give the same symbol without quotes for an alternative entry point. You
@@ -285,7 +246,7 @@ do { \
"wr0", "wr1", "wr2", "wr3", \
"wr4", "wr5", "wr6", "wr7", \
"wr8", "wr9", "wr10", "wr11", \
- "wr12", "wr13", "wr14", "wr15"
+ "wr12", "wr13", "wr14", "wr15" \
}
#define ADDITIONAL_REGISTER_NAMES \
diff --git a/gcc/config/arm/aout.h b/gcc/config/arm/aout.h
index 23679ebdb1d..1f060fafc7b 100644
--- a/gcc/config/arm/aout.h
+++ b/gcc/config/arm/aout.h
@@ -20,24 +20,6 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef ARM_OS_NAME
-#define ARM_OS_NAME "(generic)"
-#endif
-
-/* The text to go at the start of the assembler file. */
-#ifndef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
-{ \
- asm_fprintf (STREAM,"%Rrfp\t.req\t%Rr9\n"); \
- asm_fprintf (STREAM,"%Rsl\t.req\t%Rr10\n"); \
- asm_fprintf (STREAM,"%Rfp\t.req\t%Rr11\n"); \
- asm_fprintf (STREAM,"%Rip\t.req\t%Rr12\n"); \
- asm_fprintf (STREAM,"%Rsp\t.req\t%Rr13\n"); \
- asm_fprintf (STREAM,"%Rlr\t.req\t%Rr14\n"); \
- asm_fprintf (STREAM,"%Rpc\t.req\t%Rr15\n"); \
-}
-#endif
-
#ifndef ASM_APP_ON
#define ASM_APP_ON ""
#endif
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index e5b1324c546..c0ee99ed8c3 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -147,6 +147,7 @@ static void arm_encode_section_info (tree, rtx, int);
static void aof_globalize_label (FILE *, const char *);
static void aof_dump_imports (FILE *);
static void aof_dump_pic_table (FILE *);
+static void aof_file_start (void);
static void aof_file_end (void);
#endif
@@ -169,6 +170,8 @@ static void aof_file_end (void);
#define TARGET_ASM_ALIGNED_SI_OP "\tDCD\t"
#undef TARGET_ASM_GLOBALIZE_LABEL
#define TARGET_ASM_GLOBALIZE_LABEL aof_globalize_label
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START aof_file_start
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END aof_file_end
#else
@@ -12839,6 +12842,37 @@ aof_globalize_label (FILE *stream, const char *name)
}
static void
+aof_file_start ()
+{
+ fputs ("__r0\tRN\t0\n", asm_out_file);
+ fputs ("__a1\tRN\t0\n", asm_out_file);
+ fputs ("__a2\tRN\t1\n", asm_out_file);
+ fputs ("__a3\tRN\t2\n", asm_out_file);
+ fputs ("__a4\tRN\t3\n", asm_out_file);
+ fputs ("__v1\tRN\t4\n", asm_out_file);
+ fputs ("__v2\tRN\t5\n", asm_out_file);
+ fputs ("__v3\tRN\t6\n", asm_out_file);
+ fputs ("__v4\tRN\t7\n", asm_out_file);
+ fputs ("__v5\tRN\t8\n", asm_out_file);
+ fputs ("__v6\tRN\t9\n", asm_out_file);
+ fputs ("__sl\tRN\t10\n", asm_out_file);
+ fputs ("__fp\tRN\t11\n", asm_out_file);
+ fputs ("__ip\tRN\t12\n", asm_out_file);
+ fputs ("__sp\tRN\t13\n", asm_out_file);
+ fputs ("__lr\tRN\t14\n", asm_out_file);
+ fputs ("__pc\tRN\t15\n", asm_out_file);
+ fputs ("__f0\tFN\t0\n", asm_out_file);
+ fputs ("__f1\tFN\t1\n", asm_out_file);
+ fputs ("__f2\tFN\t2\n", asm_out_file);
+ fputs ("__f3\tFN\t3\n", asm_out_file);
+ fputs ("__f4\tFN\t4\n", asm_out_file);
+ fputs ("__f5\tFN\t5\n", asm_out_file);
+ fputs ("__f6\tFN\t6\n", asm_out_file);
+ fputs ("__f7\tFN\t7\n", asm_out_file);
+ text_section ();
+}
+
+static void
aof_file_end (void)
{
if (flag_pic)
diff --git a/gcc/config/arm/coff.h b/gcc/config/arm/coff.h
index df47bcf3c8b..c4f0932e9ce 100644
--- a/gcc/config/arm/coff.h
+++ b/gcc/config/arm/coff.h
@@ -45,21 +45,7 @@
#include "dbxcoff.h"
-/* A C statement to output assembler commands which will identify the
- object file as having been compiled with GCC (or another GNU
- compiler). */
-
-/* This outputs a lot of .req's to define alias for various registers.
- Let's try to avoid this. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- fprintf (STREAM, "%s Generated by gcc %s for ARM/coff\n", \
- ASM_COMMENT_START, version_string); \
- fprintf (STREAM, ASM_APP_OFF); \
- } \
- while (0)
+#define TARGET_ASM_FILE_START_APP_OFF true
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION default_coff_asm_named_section
diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h
index 89f18f26190..581f7267900 100644
--- a/gcc/config/arm/elf.h
+++ b/gcc/config/arm/elf.h
@@ -114,20 +114,8 @@
{ "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
#endif
-
-/* This outputs a lot of .req's to define alias for various registers.
- Let's try to avoid this. */
-#ifndef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- fprintf (STREAM, "%s Generated by gcc %s for ARM/elf\n", \
- ASM_COMMENT_START, version_string); \
- output_file_directive (STREAM, main_input_filename); \
- fprintf (STREAM, ASM_APP_OFF); \
- } \
- while (0)
-#endif
+#define TARGET_ASM_FILE_START_APP_OFF true
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION arm_elf_asm_named_section
diff --git a/gcc/config/arm/freebsd.h b/gcc/config/arm/freebsd.h
index ef599ad9cc7..fd79f1f3c68 100644
--- a/gcc/config/arm/freebsd.h
+++ b/gcc/config/arm/freebsd.h
@@ -47,8 +47,5 @@
#undef SUBTARGET_CPU_DEFAULT
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_strongarm
-#undef ARM_OS_NAME
-#define ARM_OS_NAME "FreeBSD"
-
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (FreeBSD/StrongARM ELF)");
diff --git a/gcc/config/arm/linux-gas.h b/gcc/config/arm/linux-gas.h
index f3ed5f88670..69112841893 100644
--- a/gcc/config/arm/linux-gas.h
+++ b/gcc/config/arm/linux-gas.h
@@ -23,10 +23,6 @@
/* This is how we tell the assembler that a symbol is weak.
GAS always supports weak symbols. */
-/* This is used in ASM_FILE_START. */
-#undef ARM_OS_NAME
-#define ARM_OS_NAME "Linux"
-
/* Unsigned chars produces much better code than signed. */
#define DEFAULT_SIGNED_CHAR 0
diff --git a/gcc/config/arm/netbsd-elf.h b/gcc/config/arm/netbsd-elf.h
index 91ba9cd445c..a8b43f645d3 100644
--- a/gcc/config/arm/netbsd-elf.h
+++ b/gcc/config/arm/netbsd-elf.h
@@ -23,10 +23,6 @@
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (NetBSD/arm ELF)", stderr);
-/* This is used in ASM_FILE_START. */
-#undef ARM_OS_NAME
-#define ARM_OS_NAME "NetBSD"
-
/* arm.h defaults to ARM6 CPU. */
/* This defaults us to little-endian. */
diff --git a/gcc/config/arm/netbsd.h b/gcc/config/arm/netbsd.h
index d7e6837a254..c1db2df5e26 100644
--- a/gcc/config/arm/netbsd.h
+++ b/gcc/config/arm/netbsd.h
@@ -23,10 +23,6 @@
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (ARM/NetBSD)", stderr);
-/* This is used in ASM_FILE_START. */
-#undef ARM_OS_NAME
-#define ARM_OS_NAME "NetBSD"
-
/* Unsigned chars produces much better code than signed. */
#define DEFAULT_SIGNED_CHAR 0
diff --git a/gcc/config/arm/pe.h b/gcc/config/arm/pe.h
index a8ca0d47543..bd0b6606247 100644
--- a/gcc/config/arm/pe.h
+++ b/gcc/config/arm/pe.h
@@ -104,17 +104,7 @@
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION default_pe_asm_named_section
-/* This outputs a lot of .req's to define alias for various registers.
- Let's try to avoid this. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- asm_fprintf (STREAM, "%@ Generated by gcc %s for ARM/pe\n",\
- version_string); \
- output_file_directive ((STREAM), main_input_filename); \
- } \
- while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* Output a reference to a label. */
#undef ASM_OUTPUT_LABELREF
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index f4953887571..fafd36c83fe 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -22,7 +22,6 @@
extern int function_arg_regno_p PARAMS ((int r));
-extern void asm_file_start PARAMS ((FILE *file));
extern void avr_init_once PARAMS ((void));
extern void avr_override_options PARAMS ((void));
extern void avr_optimization_options PARAMS ((int level, int size));
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index fe883f9d3f9..d6fcd4770f5 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -63,6 +63,7 @@ static tree avr_handle_progmem_attribute PARAMS ((tree *, tree, tree, int, boo
static tree avr_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
const struct attribute_spec avr_attribute_table[];
static bool avr_assemble_integer PARAMS ((rtx, unsigned int, int));
+static void avr_file_start PARAMS ((void));
static void avr_file_end PARAMS ((void));
static void avr_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void avr_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
@@ -219,6 +220,10 @@ int avr_case_values_threshold = 30000;
#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER avr_assemble_integer
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START avr_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END avr_file_end
@@ -4888,30 +4893,30 @@ avr_section_type_flags (decl, name, reloc)
return flags;
}
-/* Outputs to the stdio stream FILE some
- appropriate text to go at the start of an assembler file. */
+/* Outputs some appropriate text to go at the start of an assembler
+ file. */
-void
-asm_file_start (file)
- FILE *file;
+static void
+avr_file_start ()
{
if (avr_asm_only_p)
error ("MCU `%s' supported for assembler only", avr_mcu_name);
- output_file_directive (file, main_input_filename);
- fprintf (file, "\t.arch %s\n", avr_mcu_name);
+ default_file_start ();
+
+ fprintf (asm_out_file, "\t.arch %s\n", avr_mcu_name);
fputs ("__SREG__ = 0x3f\n"
"__SP_H__ = 0x3e\n"
- "__SP_L__ = 0x3d\n", file);
+ "__SP_L__ = 0x3d\n", asm_out_file);
fputs ("__tmp_reg__ = 0\n"
- "__zero_reg__ = 1\n", file);
+ "__zero_reg__ = 1\n", asm_out_file);
/* FIXME: output these only if there is anything in the .data / .bss
sections - some code size could be saved by not linking in the
initialization code from libgcc if one or both sections are empty. */
- fputs ("\t.global __do_copy_data\n", file);
- fputs ("\t.global __do_clear_bss\n", file);
+ fputs ("\t.global __do_copy_data\n", asm_out_file);
+ fputs ("\t.global __do_clear_bss\n", asm_out_file);
commands_in_file = 0;
commands_in_prologues = 0;
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 4bdad072061..8255e199de8 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -1687,18 +1687,6 @@ progmem_section () \
This macro is irrelevant if there is no separate readonly data
section. */
-#define ASM_FILE_START(STREAM) asm_file_start (STREAM)
-/* A C expression which outputs to the stdio stream STREAM some
- appropriate text to go at the start of an assembler file.
-
- Normally this macro is defined to output a line containing
- `#NO_APP', which is a comment that has no effect on most
- assemblers but tells the GNU assembler that it can save time by not
- checking for certain assembler constructs.
-
- On systems that use SDB, it is necessary to output certain
- commands; see `attasm.h'. */
-
#define ASM_COMMENT_START " ; "
/* A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 06bb73782d6..5d097cc0cda 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -185,6 +185,7 @@ static int c4x_valid_operands PARAMS ((enum rtx_code, rtx *,
enum machine_mode, int));
static int c4x_arn_reg_operand PARAMS ((rtx, enum machine_mode, unsigned int));
static int c4x_arn_mem_operand PARAMS ((rtx, enum machine_mode, unsigned int));
+static void c4x_file_start PARAMS ((void));
static void c4x_file_end PARAMS ((void));
static void c4x_check_attribute PARAMS ((const char *, tree, tree, tree *));
static int c4x_r11_set_p PARAMS ((rtx));
@@ -207,6 +208,10 @@ static int c4x_address_cost PARAMS ((rtx));
#define TARGET_ASM_ALIGNED_HI_OP NULL
#undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP NULL
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START c4x_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END c4x_file_end
@@ -4563,6 +4568,26 @@ c4x_external_ref (name)
extern_head = p;
}
+/* We need to have a data section we can identify so that we can set
+ the DP register back to a data pointer in the small memory model.
+ This is only required for ISRs if we are paranoid that someone
+ may have quietly changed this register on the sly. */
+static void
+c4x_file_start ()
+{
+ int dspversion = 0;
+ if (TARGET_C30) dspversion = 30;
+ if (TARGET_C31) dspversion = 31;
+ if (TARGET_C32) dspversion = 32;
+ if (TARGET_C33) dspversion = 33;
+ if (TARGET_C40) dspversion = 40;
+ if (TARGET_C44) dspversion = 44;
+
+ default_file_start ();
+ fprintf (asm_out_file, "\t.version\t%d\n", dspversion);
+ fputs ("\n\t.data\ndata_sec:\n", asm_out_file);
+}
+
static void
c4x_file_end ()
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index bea00ffa1c6..fb3622bb313 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -1548,35 +1548,6 @@ fini_section () \
/* Overall Framework of an Assembler File. */
-/* We need to have a data section we can identify so that we can set
- the DP register back to a data pointer in the small memory model.
- This is only required for ISRs if we are paranoid that someone
- may have quietly changed this register on the sly. */
-
-#define ASM_FILE_START(FILE) \
-{ \
- int dspversion = 0; \
- if (TARGET_C30) dspversion = 30; \
- if (TARGET_C31) dspversion = 31; \
- if (TARGET_C32) dspversion = 32; \
- if (TARGET_C33) dspversion = 33; \
- if (TARGET_C40) dspversion = 40; \
- if (TARGET_C44) dspversion = 44; \
- fprintf (FILE, "\t.version\t%d\n", dspversion); \
- fprintf (FILE, "\t.file\t"); \
- if (TARGET_TI) \
- { \
- const char *p; \
- const char *after_dir = main_input_filename; \
- for (p = main_input_filename; *p; p++) \
- if (*p == '/') \
- after_dir = p + 1; \
- output_quoted_string (FILE, after_dir); \
- } \
- else \
- output_quoted_string (FILE, main_input_filename); \
- fputs ("\n\t.data\ndata_sec:\n", FILE); \
-}
#define ASM_COMMENT_START ";"
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index bff96df76ef..71366725c6e 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -105,6 +105,8 @@ static void cris_operand_lossage PARAMS ((const char *, rtx));
static void cris_asm_output_mi_thunk
PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
+static void cris_file_start PARAMS ((void));
+
static bool cris_rtx_costs PARAMS ((rtx, int, int, int *));
static int cris_address_cost PARAMS ((rtx));
@@ -162,6 +164,9 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START cris_file_start
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS cris_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -2761,6 +2766,24 @@ cris_asm_output_mi_thunk (stream, thunkdecl, delta, vcall_offset, funcdecl)
}
}
+/* Boilerplate emitted at start of file.
+
+ NO_APP *only at file start* means faster assembly. It also means
+ comments are not allowed. In some cases comments will be output
+ for debugging purposes. Make sure they are allowed then.
+
+ We want a .file directive only if TARGET_ELF. */
+static void
+cris_file_start ()
+{
+ /* These expressions can vary at run time, so we cannot put
+ them into TARGET_INITIALIZER. */
+ targetm.file_start_app_off = !(TARGET_PDEBUG || flag_print_asm_name);
+ targetm.file_start_file_directive = TARGET_ELF;
+
+ default_file_start ();
+}
+
/* The EXPAND_BUILTIN_VA_ARG worker. This is modified from the
"standard" implementation of va_arg: read the value from the current
address and increment by the size of one or two registers. The
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index a517830e103..6517cc5d1db 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -1392,24 +1392,6 @@ call_ ## FUNC (void) \
/* Node: File Framework */
-/* NO_APP *only at file start* means faster assembly.
- It also means comments are not allowed.
- In some cases comments will be output for debugging purposes.
- Make sure they are allowed then. */
-/* Override previous definitions (elfos.h). */
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- if (TARGET_PDEBUG || flag_print_asm_name) \
- fprintf ((STREAM), "#APP\n"); \
- else \
- fprintf ((STREAM), "#NO_APP\n"); \
- if (TARGET_ELF) \
- output_file_directive ((STREAM), main_input_filename); \
- } \
- while (0)
-
/* We don't want an .ident for gcc. To avoid that but still support
#ident, we override ASM_OUTPUT_IDENT and, since the gcc .ident is its
only use besides ASM_OUTPUT_IDENT, undef IDENT_ASM_OP from elfos.h. */
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index eebb0ee12c6..7d26c26718b 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -326,9 +326,8 @@ do { text_section (); \
/* Don't output a .file directive. That is only used by the assembler for
error reporting. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE)
+#undef ASM_FILE_START_FILE_DIRECTIVE
+#define ASM_FILE_START_FILE_DIRECTIVE false
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END darwin_file_end
diff --git a/gcc/config/dsp16xx/dsp16xx-protos.h b/gcc/config/dsp16xx/dsp16xx-protos.h
index 91496d91ee2..7e2683fbb74 100644
--- a/gcc/config/dsp16xx/dsp16xx-protos.h
+++ b/gcc/config/dsp16xx/dsp16xx-protos.h
@@ -77,9 +77,6 @@ extern int initial_frame_pointer_offset PARAMS ((void));
extern void asm_output_common PARAMS ((FILE *, const char *, int, int));
extern void asm_output_local PARAMS ((FILE *, const char *, int, int));
extern void asm_output_float PARAMS ((FILE *, double));
-extern void dsp16xx_file_start PARAMS ((void));
-extern void coff_dsp16xx_file_start PARAMS ((FILE *));
-extern void luxworks_dsp16xx_file_start PARAMS ((FILE *));
extern bool dsp16xx_compare_gen;
extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode));
extern enum reg_class dsp16xx_reg_class_from_letter PARAMS ((int));
diff --git a/gcc/config/dsp16xx/dsp16xx.c b/gcc/config/dsp16xx/dsp16xx.c
index 60b8deb46ce..d858706149f 100644
--- a/gcc/config/dsp16xx/dsp16xx.c
+++ b/gcc/config/dsp16xx/dsp16xx.c
@@ -151,6 +151,7 @@ static const char *const lshift_right_asm_first[] =
static int reg_save_size PARAMS ((void));
static void dsp16xx_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void dsp16xx_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void dsp16xx_file_start PARAMS ((void));
static bool dsp16xx_rtx_costs PARAMS ((rtx, int, int, int *));
static int dsp16xx_address_cost PARAMS ((rtx));
@@ -168,6 +169,9 @@ static int dsp16xx_address_cost PARAMS ((rtx));
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE dsp16xx_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START dsp16xx_file_start
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS dsp16xx_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -2373,49 +2377,10 @@ dsp16xx_function_arg_advance (cum, mode, type, named)
}
}
-void
-coff_dsp16xx_file_start (file)
- FILE *file;
-{
- fprintf (file, "#include <%s.h>\n", save_chip_name);
-}
-
-void
-luxworks_dsp16xx_file_start (file)
- FILE *file;
+static void
+dsp16xx_file_start ()
{
- char *temp_filename;
- int len, err_code;
-
-
- fprintf (file, "\t.debug ");
- err_code = (TARGET_DEBUG) ? fprintf (file, "yes, ") : fprintf (file, "no, ");
- err_code = (TARGET_SAVE_TEMPS) ? fprintf (file, "asm, ") : fprintf (file, "temp, ");
- len = strlen (main_input_filename);
- temp_filename = (char *) xmalloc (len + 2);
- strcpy (temp_filename, main_input_filename);
-#ifdef __CYGWIN32__
- p = temp_filename;
- while (*p != '\0') {
- if (*p == '\\')
- *p = '/';
- p++;
- }
-#endif
- fprintf (file, "\"%s\"\n", temp_filename);
-
- fprintf (file, "#include <%s.h>\n", save_chip_name);
-
- /*
- * Add dummy sections, so that they always exist in the
- * object code. These have been created so that the number and
- * type of sections remain consistent with and without -g option. Note
- * that the .data, .text, .const and .bss are always created when -g
- * is provided as an option. */
- fprintf (file, "\t.rsect \".text\" , nodelete\n");
- fprintf (file, "\t.rsect \".data\" , nodelete\n");
- fprintf (file, "\t.rsect \".const\" , nodelete\n");
- fprintf (file, "\t.rsect \".bss\" , nodelete\n");
+ fprintf (asm_out_file, "#include <%s.h>\n", save_chip_name);
}
rtx
diff --git a/gcc/config/dsp16xx/dsp16xx.h b/gcc/config/dsp16xx/dsp16xx.h
index 03e237de293..83df03371ea 100644
--- a/gcc/config/dsp16xx/dsp16xx.h
+++ b/gcc/config/dsp16xx/dsp16xx.h
@@ -1487,9 +1487,6 @@ extern struct dsp16xx_frame_info current_frame_info;
/* THE OVERALL FRAMEWORK OF AN ASSEMBLER FILE */
-/* Output at beginning of assembler file. */
-#define ASM_FILE_START(FILE) coff_dsp16xx_file_start (FILE)
-
/* A C string constant describing how to begin a comment in the target
assembler language. */
#define ASM_COMMENT_START ""
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h
index 3a04661ea33..ed9efc657cc 100644
--- a/gcc/config/elfos.h
+++ b/gcc/config/elfos.h
@@ -96,16 +96,9 @@ Boston, MA 02111-1307, USA. */
#undef SET_ASM_OP
#define SET_ASM_OP "\t.set\t"
-/* This is how to begin an assembly language file. Most svr4 assemblers want
- at least a .file directive to come first, and some want to see a .version
- directive come right after that. Here we just establish a default
- which generates only the .file directive. If you need a .version
- directive for any specific target, you should override this definition
- in the target-specific file which includes this one. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- output_file_directive ((FILE), main_input_filename)
+/* Most svr4 assemblers want a .file directive at the beginning of
+ their input file. */
+#define 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. */
diff --git a/gcc/config/h8300/elf.h b/gcc/config/h8300/elf.h
index c306993602a..7f67a3a78b1 100644
--- a/gcc/config/h8300/elf.h
+++ b/gcc/config/h8300/elf.h
@@ -31,12 +31,6 @@
%{pg:gcrti.o%s}%{!pg:crti.o%s} \
crtbegin.o%s"
-/* Output at beginning/end of assembler file. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- (output_file_directive ((FILE), main_input_filename), \
- asm_file_start (FILE))
-
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h
index 320e031946c..b86b8ab1dc8 100644
--- a/gcc/config/h8300/h8300-protos.h
+++ b/gcc/config/h8300/h8300-protos.h
@@ -94,7 +94,6 @@ extern int h8300_can_use_return_insn_p (void);
extern void h8300_expand_prologue (void);
extern void h8300_expand_epilogue (void);
extern int h8300_current_function_interrupt_function_p (void);
-extern void asm_file_start (FILE *);
extern int h8300_initial_elimination_offset (int, int);
struct cpp_reader;
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 8690a3caab9..826cd6ca9bb 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -655,29 +655,15 @@ h8300_current_function_interrupt_function_p (void)
/* Output assembly code for the start of the file. */
-void
-asm_file_start (FILE *file)
+static void
+h8300_file_start (void)
{
- fprintf (file, ";\tGCC For the Hitachi H8/300\n");
- fprintf (file, ";\tBy Hitachi America Ltd and Cygnus Support\n");
+ default_file_start ();
- if (optimize_size)
- fprintf (file, "; -Os\n");
- else if (optimize)
- fprintf (file, "; -O%d\n", optimize);
if (TARGET_H8300H)
- if (TARGET_NORMAL_MODE)
- fprintf (file, "\n\t.h8300hn\n");
- else
- fprintf (file, "\n\t.h8300h\n");
+ fputs (TARGET_NORMAL_MODE ? "\t.h8300hn\n" : "\t.h8300h\n", asm_out_file);
else if (TARGET_H8300S)
- if (TARGET_NORMAL_MODE)
- fprintf (file, "\n\t.h8300sn\n");
- else
- fprintf (file, "\n\t.h8300s\n");
- else
- fprintf (file, "\n\n");
- output_file_directive (file, main_input_filename);
+ fputs (TARGET_NORMAL_MODE ? "\t.h8300sn\n" : "\t.h8300s\n", asm_out_file);
}
/* Output assembly language code for the end of file. */
@@ -4360,6 +4346,11 @@ byte_accesses_mergeable_p (rtx addr1, rtx addr2)
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE h8300_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START h8300_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END h8300_file_end
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 03b4cc37bac..0bbeb2c1081 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -1030,10 +1030,6 @@ struct cum_arg
/* Control the assembler format that we output. */
-/* Output at beginning/end of assembler file. */
-
-#define ASM_FILE_START(FILE) asm_file_start (FILE)
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c
index cbb118b1b9b..501e353bf86 100644
--- a/gcc/config/i370/i370.c
+++ b/gcc/config/i370/i370.c
@@ -107,6 +107,7 @@ static void i370_globalize_label PARAMS ((FILE *, const char *));
#endif
static void i370_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void i370_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void i370_file_start PARAMS ((void));
static void i370_file_end PARAMS ((void));
#ifdef LONGEXTERNAL
@@ -320,6 +321,8 @@ static const unsigned char ebcasc[256] =
#define TARGET_ASM_FUNCTION_PROLOGUE i370_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE i370_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START i370_file_start
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END i370_file_end
#undef TARGET_ASM_INTERNAL_LABEL
@@ -1603,6 +1606,12 @@ i370_output_function_epilogue (file, l)
}
static void
+i370_file_start ()
+{
+ fputs ("\tRMODE\tANY\n\tCSECT\n", asm_out_file);
+}
+
+static void
i370_file_end ()
{
fputs ("\tEND\n", asm_out_file);
diff --git a/gcc/config/i370/i370.h b/gcc/config/i370/i370.h
index dd82a6f677f..93e6ea63017 100644
--- a/gcc/config/i370/i370.h
+++ b/gcc/config/i370/i370.h
@@ -1029,10 +1029,6 @@ enum reg_class
"0", "2", "4", "6" \
}
-#define ASM_FILE_START(FILE) \
-{ fputs ("\tRMODE\tANY\n", FILE); \
- fputs ("\tCSECT\n", FILE); }
-
#define ASM_COMMENT_START "*"
#define ASM_APP_OFF ""
#define ASM_APP_ON ""
diff --git a/gcc/config/i386/att.h b/gcc/config/i386/att.h
index c95b6ad881e..b51f66b65b2 100644
--- a/gcc/config/i386/att.h
+++ b/gcc/config/i386/att.h
@@ -45,14 +45,7 @@ do \
} while (0)
/* Output at beginning of assembler file. */
-/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { \
- output_file_directive (FILE, main_input_filename); \
- if (ix86_asm_dialect == ASM_INTEL) \
- fputs ("\t.intel_syntax\n", FILE); \
- } while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* This is how to output an assembler line
that says to advance the location counter
diff --git a/gcc/config/i386/gas.h b/gcc/config/i386/gas.h
index 6dec86e08a4..7104ac3d31b 100644
--- a/gcc/config/i386/gas.h
+++ b/gcc/config/i386/gas.h
@@ -121,12 +121,4 @@ Boston, MA 02111-1307, USA. */
/* Print opcodes the way that GAS expects them. */
#define GAS_MNEMONICS 1
-/* Output at beginning of assembler file. */
-/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { \
- output_file_directive (FILE, main_input_filename); \
- if (ix86_asm_dialect == ASM_INTEL) \
- fputs ("\t.intel_syntax\n", FILE); \
- } while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h
index 4d3f8603b43..c58d07ba787 100644
--- a/gcc/config/i386/i386-interix.h
+++ b/gcc/config/i386/i386-interix.h
@@ -92,16 +92,8 @@ Boston, MA 02111-1307, USA. */
/* The global __fltused is necessary to cause the printf/scanf routines
for outputting/inputting floating point numbers to be loaded. Since this
is kind of hard to detect, we just do it all the time. */
-
-#ifdef ASM_FILE_START
-#undef ASM_FILE_START
-#endif
-#define ASM_FILE_START(FILE) \
- do { fprintf (FILE, "\t.file\t"); \
- output_quoted_string (FILE, dump_base_name); \
- fprintf (FILE, "\n"); \
- fprintf (FILE, ".global\t__fltused\n"); \
- } while (0)
+#undef X86_FILE_START_FLTUSED
+#define X86_FILE_START_FLTUSED 1
/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index bc1604f8d47..8409def0e46 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -829,6 +829,7 @@ static void x86_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
static bool x86_can_output_mi_thunk PARAMS ((tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
+static void x86_file_start PARAMS ((void));
static void ix86_reorg PARAMS ((void));
bool ix86_expand_carry_flag_compare PARAMS ((enum rtx_code, rtx, rtx, rtx*));
@@ -1006,6 +1007,9 @@ static void init_ext_80387_constants PARAMS ((void));
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK x86_can_output_mi_thunk
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START x86_file_start
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS ix86_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -15532,6 +15536,18 @@ x86_output_mi_thunk (file, thunk, delta, vcall_offset, function)
}
}
+static void
+x86_file_start ()
+{
+ default_file_start ();
+ if (X86_FILE_START_VERSION_DIRECTIVE)
+ fputs ("\t.version\t\"01.01\"\n", asm_out_file);
+ if (X86_FILE_START_FLTUSED)
+ fputs ("\t.global\t__fltused\n", asm_out_file);
+ if (ix86_asm_dialect == ASM_INTEL)
+ fputs ("\t.intel_syntax\n", asm_out_file);
+}
+
int
x86_field_alignment (field, computed)
tree field;
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index b8a6b7b035d..cfc96b54f0a 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -3229,6 +3229,10 @@ struct machine_function GTY(())
#define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers)
#define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
+/* Control behavior of x86_file_start. */
+#define X86_FILE_START_VERSION_DIRECTIVE false
+#define X86_FILE_START_FLTUSED false
+
/*
Local variables:
version-control: t
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index ae6e8d045c6..98a25a95eaf 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -25,13 +25,7 @@ Boston, MA 02111-1307, USA. */
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { \
- output_file_directive (FILE, main_input_filename); \
- if (ix86_asm_dialect == ASM_INTEL) \
- fputs ("\t.intel_syntax\n", FILE); \
- } while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#define TARGET_VERSION fprintf (stderr, " (i386 Linux/ELF)");
diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h
index b4096a7ca40..b53bc21305c 100644
--- a/gcc/config/i386/sco5.h
+++ b/gcc/config/i386/sco5.h
@@ -44,12 +44,9 @@ Boston, MA 02111-1307, USA. */
#define CTORS_SECTION_ASM_OP "\t.section\t.ctors, \"aw\""
#define DTORS_SECTION_ASM_OP "\t.section\t.dtors, \"aw\""
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- output_file_directive((FILE),main_input_filename); \
- fprintf ((FILE), "\t.version\t\"01.01\"\n"); \
-} while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+#undef X86_FILE_START_VERSION_DIRECTIVE
+#define X86_FILE_START_VERSION_DIRECTIVE true
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named
diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h
index 6b3335e8923..d3e2d8b835d 100644
--- a/gcc/config/i386/sysv4.h
+++ b/gcc/config/i386/sysv4.h
@@ -34,12 +34,9 @@ Boston, MA 02111-1307, USA. */
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { \
- output_file_directive (FILE, main_input_filename); \
- fprintf (FILE, "\t.version\t\"01.01\"\n"); \
- } while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+#undef X86_FILE_START_VERSION_DIRECTIVE
+#define X86_FILE_START_VERSION_DIRECTIVE true
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
diff --git a/gcc/config/i960/i960-coff.h b/gcc/config/i960/i960-coff.h
index 47bcc8d7122..1a8ab46e544 100644
--- a/gcc/config/i960/i960-coff.h
+++ b/gcc/config/i960/i960-coff.h
@@ -32,9 +32,8 @@ Boston, MA 02111-1307, USA. */
use the standard definition of LIB_SPEC. */
#undef LIB_SPEC
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- output_file_directive ((FILE), main_input_filename)
+/* Emit a .file directive. */
+#define ASM_FILE_START_FILE_DIRECTIVE true
/* Support the ctors and dtors sections for g++. */
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index 8af0a70cd9f..89bd554d7c2 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -1161,10 +1161,6 @@ extern struct rtx_def *i960_compare_op0, *i960_compare_op1;
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(file)
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index e0760f3e17b..030c5ed667b 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -134,7 +134,7 @@ extern int ia64_register_move_cost PARAMS((enum machine_mode, enum reg_class,
enum reg_class));
extern int ia64_epilogue_uses PARAMS((int));
extern int ia64_eh_uses PARAMS((int));
-extern void emit_safe_across_calls PARAMS((FILE *));
+extern void emit_safe_across_calls PARAMS((void));
extern void ia64_init_builtins PARAMS((void));
extern void ia64_override_options PARAMS((void));
extern int ia64_dbx_register_number PARAMS((int));
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 59c2652d0cc..eea13a7d9fe 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -241,6 +241,7 @@ static void bundling PARAMS ((FILE *, int, rtx, rtx));
static void ia64_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
+static void ia64_file_start PARAMS ((void));
static void ia64_select_rtx_section PARAMS ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT));
@@ -356,6 +357,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START ia64_file_start
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS ia64_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -1608,9 +1612,15 @@ ia64_split_call (retval, addr, retaddr, scratch_r, scratch_b,
/* Begin the assembly file. */
+static void
+ia64_file_start ()
+{
+ default_file_start ();
+ emit_safe_across_calls ();
+}
+
void
-emit_safe_across_calls (f)
- FILE *f;
+emit_safe_across_calls ()
{
unsigned int rs, re;
int out_state;
@@ -1627,19 +1637,19 @@ emit_safe_across_calls (f)
continue;
if (out_state == 0)
{
- fputs ("\t.pred.safe_across_calls ", f);
+ fputs ("\t.pred.safe_across_calls ", asm_out_file);
out_state = 1;
}
else
- fputc (',', f);
+ fputc (',', asm_out_file);
if (re == rs + 1)
- fprintf (f, "p%u", rs);
+ fprintf (asm_out_file, "p%u", rs);
else
- fprintf (f, "p%u-p%u", rs, re - 1);
+ fprintf (asm_out_file, "p%u-p%u", rs, re - 1);
rs = re + 1;
}
if (out_state)
- fputc ('\n', f);
+ fputc ('\n', asm_out_file);
}
/* Helper function for ia64_compute_frame_size: find an appropriate general
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 9e1a5133582..4215c5b81cc 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1456,11 +1456,6 @@ do { \
#define EH_USES(REGNO) ia64_eh_uses (REGNO)
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(FILE) \
- emit_safe_across_calls (FILE)
-
/* Output part N of a function descriptor for DECL. For ia64, both
words are emitted with a single relocation, so ignore N > 0. */
#define ASM_OUTPUT_FDESC(FILE, DECL, PART) \
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md
index 3187211f9b8..d0c65de1a21 100644
--- a/gcc/config/ia64/ia64.md
+++ b/gcc/config/ia64/ia64.md
@@ -5432,7 +5432,7 @@
[(unspec_volatile [(const_int 0)] UNSPECV_PSAC_NORMAL)]
""
{
- emit_safe_across_calls (asm_out_file);
+ emit_safe_across_calls ();
return "";
}
[(set_attr "itanium_class" "ignore")
diff --git a/gcc/config/ia64/sysv4.h b/gcc/config/ia64/sysv4.h
index 39809cf360d..5db10895860 100644
--- a/gcc/config/ia64/sysv4.h
+++ b/gcc/config/ia64/sysv4.h
@@ -117,26 +117,6 @@ do { \
fputc ('\n', FILE); \
} while (0)
-/* A C expression which outputs to the stdio stream STREAM some appropriate
- text to go at the start of an assembler file. */
-
-/* ??? Looks like almost every port, except for a few original ones, get this
- wrong. Must emit #NO_APP as first line of file to turn of special assembler
- preprocessing of files. */
-
-/* ??? Even worse, it doesn't work, because gas does not accept the tab chars
- that dwarf2out.c emits when #NO_APP. */
-
-/* ??? Unrelated, but dwarf2out.c emits unnecessary newlines after strings,
- may as well fix at the same time. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
-do { \
- output_file_directive (STREAM, main_input_filename); \
- emit_safe_across_calls (STREAM); \
-} while (0)
-
/* Override default elf definition. */
#undef TARGET_ASM_SELECT_RTX_SECTION
#define TARGET_ASM_SELECT_RTX_SECTION ia64_select_rtx_section
diff --git a/gcc/config/m32r/m32r-protos.h b/gcc/config/m32r/m32r-protos.h
index 103bff790bf..db84b7af683 100644
--- a/gcc/config/m32r/m32r-protos.h
+++ b/gcc/config/m32r/m32r-protos.h
@@ -30,7 +30,6 @@ extern unsigned m32r_compute_frame_size PARAMS ((int));
extern int m32r_first_insn_address PARAMS ((void));
extern void m32r_expand_prologue PARAMS ((void));
extern void m32r_finalize_pic PARAMS ((void));
-extern void m32r_asm_file_start PARAMS ((FILE *));
extern int direct_return PARAMS ((void));
#ifdef TREE_CODE
extern enum m32r_function_type m32r_compute_function_type PARAMS ((tree));
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 55b7cf71d80..3622d0657ea 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -77,6 +77,8 @@ static tree m32r_handle_model_attribute PARAMS ((tree *, tree, tree, int, bool
static void m32r_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void m32r_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void m32r_file_start PARAMS ((void));
+
static int m32r_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static int m32r_adjust_priority PARAMS ((rtx, int));
static void m32r_sched_init PARAMS ((FILE *, int, int));
@@ -103,6 +105,9 @@ static bool m32r_rtx_costs PARAMS ((rtx, int, int, int *));
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m32r_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START m32r_file_start
+
#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST m32r_adjust_cost
#undef TARGET_SCHED_ADJUST_PRIORITY
@@ -2215,15 +2220,13 @@ m32r_initialize_trampoline (tramp, fnaddr, cxt)
{
}
-/* Set the cpu type and print out other fancy things,
- at the top of the file. */
-
-void
-m32r_asm_file_start (file)
- FILE * file;
+static void
+m32r_file_start ()
{
+ default_file_start ();
+
if (flag_verbose_asm)
- fprintf (file,
+ fprintf (asm_out_file,
"%s M32R/D special options: -G " HOST_WIDE_INT_PRINT_UNSIGNED "\n",
ASM_COMMENT_START, g_switch_value);
}
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index b4906838bd3..815de108844 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -30,7 +30,6 @@ Boston, MA 02111-1307, USA. */
#undef PTRDIFF_TYPE
#undef WCHAR_TYPE
#undef WCHAR_TYPE_SIZE
-#undef ASM_FILE_START
#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#undef TARGET_VERSION
#undef CPP_SPEC
@@ -1517,9 +1516,6 @@ do { \
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-#define ASM_FILE_START(FILE) m32r_asm_file_start (FILE)
-
/* A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will
end at the end of the line. */
diff --git a/gcc/config/m68hc11/m68hc11-protos.h b/gcc/config/m68hc11/m68hc11-protos.h
index d2d53388b4b..ff670a9088b 100644
--- a/gcc/config/m68hc11/m68hc11-protos.h
+++ b/gcc/config/m68hc11/m68hc11-protos.h
@@ -33,8 +33,6 @@ extern int m68hc11_initial_elimination_offset PARAMS((int, int));
extern void expand_prologue PARAMS((void));
extern void expand_epilogue PARAMS((void));
-extern void m68hc11_asm_file_start PARAMS((FILE*, const char*));
-
#ifdef TREE_CODE
extern void m68hc11_function_arg_advance PARAMS((CUMULATIVE_ARGS*,
enum machine_mode,
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index dd46dbde03e..b40c4e75cd4 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -58,7 +58,6 @@ Note:
#include "target.h"
#include "target-def.h"
-static void print_options PARAMS ((FILE *));
static void emit_move_after_reload PARAMS ((rtx, rtx, rtx));
static rtx simplify_logical PARAMS ((enum machine_mode, int, rtx, rtx *));
static void m68hc11_emit_logical PARAMS ((enum machine_mode, int, rtx *));
@@ -82,6 +81,7 @@ static void asm_print_register PARAMS ((FILE *, int));
static void m68hc11_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static void m68hc11_asm_out_constructor PARAMS ((rtx, int));
static void m68hc11_asm_out_destructor PARAMS ((rtx, int));
+static void m68hc11_file_start PARAMS ((void));
static void m68hc11_encode_section_info PARAMS((tree, rtx, int));
static int autoinc_mode PARAMS((rtx));
static int m68hc11_make_autoinc_notes PARAMS((rtx *, void *));
@@ -230,6 +230,11 @@ static int nb_soft_regs;
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m68hc11_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START m68hc11_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO m68hc11_encode_section_info
@@ -5660,62 +5665,12 @@ m68hc11_rtx_costs (x, code, outer_code, total)
}
-/* print_options - called at the start of the code generation for a
- module. */
-
-#include <time.h>
-#include <sys/types.h>
-
static void
-print_options (out)
- FILE *out;
-{
- const char *a_time;
- long c_time;
- int i;
- extern int save_argc;
- extern char **save_argv;
-
- fprintf (out, ";;; Command:\t");
- for (i = 0; i < save_argc; i++)
- {
- fprintf (out, "%s", save_argv[i]);
- if (i + 1 < save_argc)
- fprintf (out, " ");
- }
- fprintf (out, "\n");
- c_time = time (0);
- a_time = ctime (&c_time);
- fprintf (out, ";;; Compiled:\t%s", a_time);
-#ifdef __GNUC__
-#ifndef __VERSION__
-#define __VERSION__ "[unknown]"
-#endif
- fprintf (out, ";;; (META)compiled by GNU C version %s.\n", __VERSION__);
-#else
- fprintf (out, ";;; (META)compiled by CC.\n");
-#endif
-}
-
-void
-m68hc11_asm_file_start (out, main_file)
- FILE *out;
- const char *main_file;
+m68hc11_file_start ()
{
- fprintf (out, ";;;-----------------------------------------\n");
- fprintf (out, ";;; Start %s gcc assembly output\n",
- TARGET_M6811
- ? "MC68HC11"
- : TARGET_M68S12 ? "MC68HCS12" : "MC68HC12");
- fprintf (out, ";;; gcc compiler %s\n", version_string);
- print_options (out);
- fprintf (out, ";;;-----------------------------------------\n");
- output_file_directive (out, main_file);
-
- if (TARGET_SHORT)
- fprintf (out, "\t.mode mshort\n");
- else
- fprintf (out, "\t.mode mlong\n");
+ default_file_start ();
+
+ fprintf (asm_out_file, "\t.mode %s\n", TARGET_SHORT ? "mshort" : "mlong");
}
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index d2c70906ce6..1492c775b32 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -1511,17 +1511,6 @@ do { \
#define TARGET_ASM_CONSTRUCTOR m68hc11_asm_out_constructor
#define TARGET_ASM_DESTRUCTOR m68hc11_asm_out_destructor
-/* This is how to begin an assembly language file. Most svr4 assemblers want
- at least a .file directive to come first, and some want to see a .version
- directive come right after that. Here we just establish a default
- which generates only the .file directive. If you need a .version
- directive for any specific target, you should override this definition
- in the target-specific file which includes this one. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- m68hc11_asm_file_start ((FILE), main_input_filename)
-
/* Comment character */
#define ASM_COMMENT_START ";"
diff --git a/gcc/config/m68k/coff.h b/gcc/config/m68k/coff.h
index 062a4b6489a..824805df456 100644
--- a/gcc/config/m68k/coff.h
+++ b/gcc/config/m68k/coff.h
@@ -76,9 +76,7 @@ Boston, MA 02111-1307, USA. */
"%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
"%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- output_file_directive ((FILE), main_input_filename)
+#define ASM_FILE_START_FILE_DIRECTIVE true
/* If defined, a C expression whose value is a string containing the
assembler operation to identify the following data as uninitialized global
diff --git a/gcc/config/m68k/hp320.h b/gcc/config/m68k/hp320.h
index 0830707334d..a755aca672c 100644
--- a/gcc/config/m68k/hp320.h
+++ b/gcc/config/m68k/hp320.h
@@ -112,7 +112,6 @@ Boston, MA 02111-1307, USA. */
#endif /* default is -msoft-float */
-
/* -m68000 requires special flags to the assembler. */
#define ASM_SPEC \
"%{m68000:-mc68000}%{mc68000:-mc68000}%{!mc68000:%{!m68000:-mc68020}}"
@@ -168,7 +167,6 @@ Boston, MA 02111-1307, USA. */
#undef REGISTER_NAMES
#undef ASM_OUTPUT_REG_PUSH
#undef ASM_OUTPUT_REG_POP
-#undef ASM_FILE_START
#undef ASM_APP_ON
#undef ASM_APP_OFF
#undef TEXT_SECTION_ASM_OP
@@ -211,16 +209,7 @@ Boston, MA 02111-1307, USA. */
fprintf (FILE, "\tmov.l (%%sp)+,%s\n", reg_names[REGNO])
/* For HPUX versions before 6.5, define this macro as empty. */
-#define ASM_FILE_START(FILE) \
- if (TARGET_68020) \
- { \
- if (TARGET_68881) \
- fprintf (FILE, "\tversion 3\n"); /* 68020 fp regs saved */ \
- else \
- fprintf (FILE, "\tversion 2\n"); /* 68020 no fp regs saved */ \
- } \
- else \
- fprintf (FILE, "\tversion 1\n"); /* 68010 */
+#define TARGET_ASM_FILE_START m68k_hp320_file_start
#define ASM_APP_ON ""
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 02b09117d6e..d4df6cf3351 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -59,6 +59,7 @@ static void m68k_svr3_asm_out_constructor PARAMS ((rtx, int));
#endif
#ifdef HPUX_ASM
static void m68k_hp320_internal_label PARAMS ((FILE *, const char *, unsigned long));
+static void m68k_hp320_file_start PARAMS ((void));
#endif
static void m68k_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
@@ -131,6 +132,9 @@ int m68k_last_compare_had_fp_operands;
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
+#undef TARGET_ASM_FILE_START_APP_OFF
+#define TARGET_ASM_FILE_START_APP_OFF true
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS m68k_rtx_costs
@@ -3663,6 +3667,16 @@ m68k_hp320_internal_label (stream, prefix, labelno)
else
fprintf (stream, "%s%ld:\n", prefix, labelno);
}
+
+static void
+m68k_hp320_file_start ()
+{
+ /* version 1: 68010.
+ 2: 68020 without FPU.
+ 3: 68020 with FPU. */
+ fprintf (asm_out_file, "\tversion %d\n",
+ TARGET_68020 ? (TARGET_68881 ? 3 : 2) : 1);
+}
#endif
static void
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index a3f04e6766c..12c30b8ba26 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -1292,11 +1292,6 @@ __transfer_from_trampoline () \
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(FILE) \
- fprintf (FILE, "#NO_APP\n");
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/mcore/mcore-pe.h b/gcc/config/mcore/mcore-pe.h
index 2aaa9772f66..35055e5762f 100644
--- a/gcc/config/mcore/mcore-pe.h
+++ b/gcc/config/mcore/mcore-pe.h
@@ -105,15 +105,7 @@ drectve_section () \
} \
while (0);
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- fprintf (STREAM, "%s Generated by gcc %s for MCore/pe\n", \
- ASM_COMMENT_START, version_string); \
- output_file_directive ((STREAM), main_input_filename); \
- } \
- while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef ASM_OUTPUT_SOURCE_LINE
#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index 9ba7d21d2c1..6a3e792290c 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -356,8 +356,6 @@ current_section_flags () \
/* SGI assembler needs all sorts of extra help to do alignment properly. */
#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN iris6_asm_output_align
-#undef ASM_FILE_START
-#define ASM_FILE_START iris6_asm_file_start
#undef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT (32768*8)
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index 41b30733051..217647bbfbd 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -28,8 +28,6 @@ Boston, MA 02111-1307, USA. */
extern HOST_WIDE_INT compute_frame_size PARAMS ((HOST_WIDE_INT));
extern int mips_initial_elimination_offset PARAMS ((int, int));
-extern void mips_asm_file_start PARAMS ((FILE *));
-extern void iris6_asm_file_start PARAMS ((FILE *));
extern void iris6_asm_output_align PARAMS ((FILE *, unsigned));
extern const char * current_section_name PARAMS ((void));
extern unsigned int current_section_flags PARAMS ((void));
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 714f637d620..ef43a1af281 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -276,6 +276,7 @@ static void iris6_asm_named_section PARAMS ((const char *,
static int iris_section_align_entry_eq PARAMS ((const void *, const void *));
static hashval_t iris_section_align_entry_hash PARAMS ((const void *));
static int iris6_section_align_1 PARAMS ((void **, void *));
+static void iris6_file_start PARAMS ((void));
static void iris6_file_end PARAMS ((void));
#endif
static int mips_adjust_cost PARAMS ((rtx, rtx, rtx, int));
@@ -292,6 +293,7 @@ static int mips_use_dfa_pipeline_interface PARAMS ((void));
static bool mips_rtx_costs PARAMS ((rtx, int, int, int *));
static int mips_address_cost PARAMS ((rtx));
static void mips_encode_section_info PARAMS ((tree, rtx, int));
+static void mips_file_start PARAMS ((void));
static void mips_file_end PARAMS ((void));
/* Structure to be filled in by compute_frame_size with register
@@ -875,12 +877,17 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG mips_reorg
+#undef TARGET_ASM_FILE_START
#undef TARGET_ASM_FILE_END
#ifdef TARGET_IRIX6
+#define TARGET_ASM_FILE_START iris6_file_start
#define TARGET_ASM_FILE_END iris6_file_end
#else
+#define TARGET_ASM_FILE_START mips_file_start
#define TARGET_ASM_FILE_END mips_file_end
#endif
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -6101,11 +6108,10 @@ mips_output_ascii (stream, string_param, len)
relevant .comm/.lcomm/.extern/.sdata declaration when the code is
processed, it generates a two instruction sequence. */
-void
-mips_asm_file_start (stream)
- FILE *stream;
+static void
+mips_file_start ()
{
- ASM_OUTPUT_SOURCE_FILENAME (stream, main_input_filename);
+ default_file_start ();
/* Versions of the MIPS assembler before 2.20 generate errors if a branch
inside of a .set noreorder section jumps to a label outside of the .set
@@ -6113,7 +6119,7 @@ mips_asm_file_start (stream)
fixing the bug. */
if (TARGET_MIPS_AS && optimize && flag_delayed_branch)
- fprintf (stream, "\t.set\tnobopt\n");
+ fprintf (asm_out_file, "\t.set\tnobopt\n");
if (TARGET_GAS)
{
@@ -6141,28 +6147,26 @@ mips_asm_file_start (stream)
because in this way we can avoid creating an allocated section. We
do not want this section to take up any space in the running
executable. */
- fprintf (stream, "\t.section .mdebug.%s\n", abi_string);
+ fprintf (asm_out_file, "\t.section .mdebug.%s\n", abi_string);
/* Restore the default section. */
- fprintf (stream, "\t.previous\n");
+ fprintf (asm_out_file, "\t.previous\n");
#endif
}
-
-
/* Generate the pseudo ops that System V.4 wants. */
#ifndef ABICALLS_ASM_OP
#define ABICALLS_ASM_OP "\t.abicalls"
#endif
if (TARGET_ABICALLS)
/* ??? but do not want this (or want pic0) if -non-shared? */
- fprintf (stream, "%s\n", ABICALLS_ASM_OP);
+ fprintf (asm_out_file, "%s\n", ABICALLS_ASM_OP);
if (TARGET_MIPS16)
- fprintf (stream, "\t.set\tmips16\n");
+ fprintf (asm_out_file, "\t.set\tmips16\n");
if (flag_verbose_asm)
- fprintf (stream, "\n%s -G value = %d, Arch = %s, ISA = %d\n",
+ fprintf (asm_out_file, "\n%s -G value = %d, Arch = %s, ISA = %d\n",
ASM_COMMENT_START,
mips_section_threshold, mips_arch_info->name, mips_isa);
}
@@ -10336,15 +10340,13 @@ iris6_asm_output_align (file, log)
switching games so that we can emit a .section directive at the
beginning of the file with the proper alignment attached. */
-void
-iris6_asm_file_start (stream)
- FILE *stream;
+static void
+iris6_file_start ()
{
- mips_asm_file_start (stream);
+ mips_file_start ();
iris_orig_asm_out_file = asm_out_file;
- stream = tmpfile ();
- asm_out_file = stream;
+ asm_out_file = tmpfile ();
iris_section_align_htab = htab_create (31, iris_section_align_entry_hash,
iris_section_align_entry_eq, NULL);
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index b00c52ab0c0..bd1d8b6fa28 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3276,17 +3276,6 @@ typedef struct mips_args {
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file.
- If we are optimizing to use the global pointer, create a temporary
- file to hold all of the text stuff, and write it out to the end.
- This is needed because the MIPS assembler is evidently one pass,
- and if it hasn't seen the relevant .comm/.lcomm/.extern/.sdata
- declaration when the code is processed, it generates a two
- instruction sequence. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) mips_asm_file_start (STREAM)
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index 24ba4813209..7e04d6aa998 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -33,7 +33,6 @@ extern int mmix_register_move_cost
PARAMS ((enum machine_mode, enum reg_class, enum reg_class));
extern const char *mmix_text_section_asm_op PARAMS ((void));
extern const char *mmix_data_section_asm_op PARAMS ((void));
-extern void mmix_asm_file_start PARAMS ((FILE *));
extern void mmix_asm_output_source_filename PARAMS ((FILE *, const char *));
extern void mmix_output_quoted_string PARAMS ((FILE *, const char *, int));
extern void mmix_asm_output_source_line PARAMS ((FILE *, int));
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index bf2a4a22f21..290b5d83e07 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -135,6 +135,7 @@ static void mmix_target_asm_function_epilogue
static void mmix_reorg PARAMS ((void));
static void mmix_asm_output_mi_thunk
PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
+static void mmix_file_start PARAMS ((void));
static void mmix_file_end PARAMS ((void));
static bool mmix_rtx_costs
PARAMS ((rtx, int, int, int *));
@@ -174,6 +175,10 @@ static bool mmix_rtx_costs
#define TARGET_ASM_OUTPUT_MI_THUNK mmix_asm_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START mmix_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END mmix_file_end
@@ -1297,17 +1302,15 @@ mmix_strip_name_encoding (name)
return name;
}
-/* ASM_FILE_START. */
+/* TARGET_ASM_FILE_START.
+ We just emit a little comment for the time being. */
-void
-mmix_asm_file_start (stream)
- FILE * stream;
+static void
+mmix_file_start ()
{
- /* We just emit a little comment for the time being. FIXME: Perhaps add
- -mstandalone and some segment and prefix setup here. */
- ASM_OUTPUT_SOURCE_FILENAME (stream, main_input_filename);
+ default_file_start ();
- fprintf (stream, "! mmixal:= 8H LOC Data_Section\n");
+ fputs ("! mmixal:= 8H LOC Data_Section\n", asm_out_file);
/* Make sure each file starts with the text section. */
text_section ();
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index fbfd91bf944..95c64447724 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -919,9 +919,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
/* Node: File Framework */
-#define ASM_FILE_START(STREAM) \
- mmix_asm_file_start (STREAM)
-
/* While any other punctuation character but ";" would do, we prefer "%"
or "!"; "!" is an unary operator and so will not be mistakenly included
in correctly formed expressions. The hash character adds mass; catches
diff --git a/gcc/config/mn10300/mn10300-protos.h b/gcc/config/mn10300/mn10300-protos.h
index 4816e6f1f09..209a7e6c891 100644
--- a/gcc/config/mn10300/mn10300-protos.h
+++ b/gcc/config/mn10300/mn10300-protos.h
@@ -53,7 +53,6 @@ extern struct rtx_def *mn10300_va_arg PARAMS ((tree, tree));
#endif /* TREE_CODE */
extern struct rtx_def *mn10300_builtin_saveregs PARAMS ((void));
-extern void asm_file_start PARAMS ((FILE *));
extern void expand_prologue PARAMS ((void));
extern void expand_epilogue PARAMS ((void));
extern int initial_offset PARAMS ((int, int));
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 5a281260ca3..da2185dc029 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -58,6 +58,7 @@ Boston, MA 02111-1307, USA. */
static int mn10300_address_cost_1 PARAMS ((rtx, int *));
static int mn10300_address_cost PARAMS ((rtx));
static bool mn10300_rtx_costs PARAMS ((rtx, int, int, int *));
+static void mn10300_file_start PARAMS ((void));
/* Initialize the GCC target structure. */
@@ -69,21 +70,20 @@ static bool mn10300_rtx_costs PARAMS ((rtx, int, int, int *));
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST mn10300_address_cost
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START mn10300_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+
struct gcc_target targetm = TARGET_INITIALIZER;
-void
-asm_file_start (file)
- FILE *file;
+static void
+mn10300_file_start ()
{
- fprintf (file, "#\tGCC For the Matsushita MN10300\n");
- if (optimize)
- fprintf (file, "# -O%d\n", optimize);
- else
- fprintf (file, "\n\n");
+ default_file_start ();
if (TARGET_AM33)
- fprintf (file, "\t.am33\n");
- output_file_directive (file, main_input_filename);
+ fprintf (asm_out_file, "\t.am33\n");
}
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 88d6fdcd58e..cae8f2a3f81 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -839,10 +839,6 @@ struct cum_arg {int nbytes; };
#define DATA_SECTION_ASM_OP "\t.section .data"
#define BSS_SECTION_ASM_OP "\t.section .bss"
-/* Output at beginning/end of assembler file. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) asm_file_start(FILE)
-
#define ASM_COMMENT_START "#"
/* Output to assembler file text saying following lines
diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c
index 248e9b4f964..10ee5cf3595 100644
--- a/gcc/config/ns32k/ns32k.c
+++ b/gcc/config/ns32k/ns32k.c
@@ -96,6 +96,9 @@ static int ns32k_address_cost PARAMS ((rtx));
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST ns32k_address_cost
+#undef TARGET_ASM_FILE_START_APP_OFF
+#define TARGET_ASM_FILE_START_APP_OFF true
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Generate the assembly code for function entry. FILE is a stdio
diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h
index 17979fb8680..0236a420da9 100644
--- a/gcc/config/ns32k/ns32k.h
+++ b/gcc/config/ns32k/ns32k.h
@@ -1256,10 +1256,6 @@ __transfer_from_trampoline () \
/* Define the output Assembly Language */
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(FILE) fprintf (FILE, "#NO_APP\n");
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/pa/elf.h b/gcc/config/pa/elf.h
index e5b7478154e..5b35178ea91 100644
--- a/gcc/config/pa/elf.h
+++ b/gcc/config/pa/elf.h
@@ -32,20 +32,7 @@ Boston, MA 02111-1307, USA. */
#define DATA_SECTION_ASM_OP "\t.data"
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- if (profile_flag)\
- fprintf (FILE, "\t.IMPORT _mcount, ENTRY\n");\
- if (write_symbols != NO_DEBUG) \
- output_file_directive ((FILE), main_input_filename); \
- } while (0)
+#define TARGET_ASM_FILE_START pa_elf_file_start
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index fa20da08ed5..ed7c82bf846 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -106,29 +106,7 @@ Boston, MA 02111-1307, USA. */
#define DATA_SECTION_ASM_OP "\t.data"
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
-/* Output at beginning of assembler file. We override the definition
- from <linux.h> so that we can get the proper .LEVEL directive. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do \
- { \
- if (write_symbols != NO_DEBUG) \
- { \
- output_file_directive (FILE, main_input_filename); \
- fputs ("\t.version\t\"01.01\"\n", FILE); \
- } \
- if (TARGET_64BIT) \
- fputs("\t.LEVEL 2.0w\n", FILE); \
- else if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- if (profile_flag) \
- fputs ("\t.IMPORT _mcount, CODE\n", FILE); \
- } \
- while (0)
+#define TARGET_ASM_FILE_START pa_linux_file_start
/* We want local labels to start with period if made with asm_fprintf. */
#undef LOCAL_LABEL_PREFIX
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 23568bedb4b..b17d1dc923f 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -135,6 +135,15 @@ static void copy_fp_args PARAMS ((rtx)) ATTRIBUTE_UNUSED;
static int length_fp_args PARAMS ((rtx)) ATTRIBUTE_UNUSED;
static struct deferred_plabel *get_plabel PARAMS ((const char *))
ATTRIBUTE_UNUSED;
+static inline void pa_file_start_level PARAMS ((void)) ATTRIBUTE_UNUSED;
+static inline void pa_file_start_space PARAMS ((int)) ATTRIBUTE_UNUSED;
+static inline void pa_file_start_file PARAMS ((int)) ATTRIBUTE_UNUSED;
+static inline void pa_file_start_mcount PARAMS ((const char*)) ATTRIBUTE_UNUSED;
+static void pa_elf_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
+static void pa_som_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
+static void pa_linux_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
+static void pa_hpux64_gas_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
+static void pa_hpux64_hpas_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
static void output_deferred_plabels PARAMS ((void));
/* Save the operands last given to a compare for use when we
@@ -4902,6 +4911,106 @@ output_global_address (file, x, round_constant)
output_addr_const (file, x);
}
+/* Output boilerplate text to appear at the beginning of the file.
+ There are several possible versions. */
+#define aputs(x) fputs(x, asm_out_file)
+static inline void
+pa_file_start_level ()
+{
+ if (TARGET_64BIT)
+ aputs ("\t.LEVEL 2.0w\n");
+ else if (TARGET_PA_20)
+ aputs ("\t.LEVEL 2.0\n");
+ else if (TARGET_PA_11)
+ aputs ("\t.LEVEL 1.1\n");
+ else
+ aputs ("\t.LEVEL 1.0\n");
+}
+
+static inline void
+pa_file_start_space (sortspace)
+ int sortspace;
+{
+ aputs ("\t.SPACE $PRIVATE$");
+ if (sortspace)
+ aputs (",SORT=16");
+ aputs ("\n\t.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31"
+ "\n\t.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82"
+ "\n\t.SPACE $TEXT$");
+ if (sortspace)
+ aputs (",SORT=8");
+ aputs ("\n\t.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44"
+ "\n\t.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n");
+}
+
+static inline void
+pa_file_start_file (want_version)
+ int want_version;
+{
+ if (write_symbols != NO_DEBUG)
+ {
+ output_file_directive (asm_out_file, main_input_filename);
+ if (want_version)
+ aputs ("\t.version\t\"01.01\"\n");
+ }
+}
+
+static inline void
+pa_file_start_mcount (aswhat)
+ const char *aswhat;
+{
+ if (profile_flag)
+ fprintf (asm_out_file, "\t.IMPORT _mcount,%s\n", aswhat);
+}
+
+static void
+pa_elf_file_start ()
+{
+ pa_file_start_level ();
+ pa_file_start_mcount ("ENTRY");
+ pa_file_start_file (0);
+}
+
+static void
+pa_som_file_start ()
+{
+ pa_file_start_level ();
+ pa_file_start_space (0);
+ aputs ("\t.IMPORT $global$,DATA\n"
+ "\t.IMPORT $$dyncall,MILLICODE\n");
+ pa_file_start_mcount ("CODE");
+ pa_file_start_file (0);
+}
+
+static void
+pa_linux_file_start ()
+{
+ pa_file_start_file (1);
+ pa_file_start_level ();
+ pa_file_start_mcount ("CODE");
+}
+
+static void
+pa_hpux64_gas_file_start ()
+{
+ pa_file_start_level ();
+#ifdef ASM_OUTPUT_TYPE_DIRECTIVE
+ if (profile_flag)
+ ASM_OUTPUT_TYPE_DIRECTIVE (asm_out_file, "_mcount", "function");
+#endif
+ pa_file_start_file (1);
+}
+
+static void
+pa_hpux64_hpas_file_start ()
+{
+ pa_file_start_level ();
+ pa_file_start_space (1);
+ pa_file_start_mcount ("CODE");
+ pa_file_start_file (0);
+}
+#undef aputs
+
static struct deferred_plabel *
get_plabel (fname)
const char *fname;
diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h
index bd652c982c4..d16d741e2d1 100644
--- a/gcc/config/pa/pa64-hpux.h
+++ b/gcc/config/pa/pa64-hpux.h
@@ -100,25 +100,8 @@ Boston, MA 02111-1307, USA. */
/* We are using GAS. */
#define TARGET_GAS 1
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- if (TARGET_64BIT) \
- fputs("\t.LEVEL 2.0w\n", FILE); \
- else if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- if (profile_flag) \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, "_mcount", "function"); \
- if (write_symbols != NO_DEBUG) \
- { \
- output_file_directive ((FILE), main_input_filename); \
- fputs ("\t.version\t\"01.01\"\n", FILE); \
- } \
-} while (0)
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START pa_hpux64_gas_file_start
/* This is how we output a null terminated string. */
#undef STRING_ASM_OP
@@ -221,28 +204,8 @@ do { \
/* This target uses the ELF object file format. */
#define OBJECT_FORMAT_ELF
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- if (TARGET_64BIT) \
- fputs("\t.LEVEL 2.0w\n", FILE); \
- else if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- fputs("\t.SPACE $PRIVATE$,SORT=16\n\
-\t.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31\n\
-\t.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82\n\
-\t.SPACE $TEXT$,SORT=8\n\
-\t.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44\n\
-\t.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n", FILE); \
- if (profile_flag) \
- fprintf (FILE, "\t.IMPORT _mcount, CODE\n"); \
- if (write_symbols != NO_DEBUG) \
- output_file_directive ((FILE), main_input_filename); \
-} while (0)
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START pa_hpux64_hpas_file_start
#undef TEXT_SECTION_ASM_OP
#define TEXT_SECTION_ASM_OP "\t.SUBSPA $CODE$\n"
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index 9a8d53d3a26..db31c6006fb 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -213,29 +213,7 @@ do { \
fputs ("\n", FILE); \
}} while (0)
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(FILE) \
-do { \
- if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- fputs ("\t.SPACE $PRIVATE$\n\
-\t.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31\n\
-\t.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82\n\
-\t.SPACE $TEXT$\n\
-\t.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44\n\
-\t.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n\
-\t.IMPORT $global$,DATA\n\
-\t.IMPORT $$dyncall,MILLICODE\n", FILE);\
- if (profile_flag)\
- fprintf (FILE, "\t.IMPORT _mcount, CODE\n");\
- if (write_symbols != NO_DEBUG) \
- output_file_directive ((FILE), main_input_filename); \
- } while (0)
+#define TARGET_ASM_FILE_START pa_som_file_start
/* Output before code. */
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index 5016145e192..317eda93330 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -990,20 +990,6 @@ extern struct rtx_def *cc0_reg_rtx;
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-
-#if 0
-#define ASM_FILE_START(FILE) \
-( \
-fprintf (FILE, "\t.data\n"), \
-fprintf (FILE, "$help$: . = .+8 ; space for tmp moves!\n") \
-/* do we need reg def's R0 = %0 etc ??? */ \
-)
-#else
-#define ASM_FILE_START(FILE)
-#endif
-
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
index 0ca22cd72d6..d40221513aa 100644
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -87,8 +87,8 @@
Don't do this until the fixed IBM assembler is more generally available.
When this becomes permanently defined, the ASM_OUTPUT_EXTERNAL,
ASM_OUTPUT_EXTERNAL_LIBCALL, and RS6000_OUTPUT_BASENAME macros will no
- longer be needed. Also, the extern declaration of mcount in ASM_FILE_START
- will no longer be needed. */
+ longer be needed. Also, the extern declaration of mcount in
+ rs6000_xcoff_file_start will no longer be needed. */
/* #define ASM_SPEC "-u %(asm_cpu)" */
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 51193905545..c1c1edb4d30 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -103,17 +103,6 @@
rs6000_override_options (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \
? (char *) 0 : TARGET_CPU_DEFAULT)
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do \
- { \
- output_file_directive ((FILE), main_input_filename); \
- rs6000_file_start (FILE, (((TARGET_DEFAULT ^ target_flags) \
- & MASK_64BIT) \
- ? (char *) 0 : TARGET_CPU_DEFAULT)); \
- } \
- while (0)
-
#endif
#undef ASM_DEFAULT_SPEC
diff --git a/gcc/config/rs6000/lynx.h b/gcc/config/rs6000/lynx.h
index 82e35b2fcb5..464b243207a 100644
--- a/gcc/config/rs6000/lynx.h
+++ b/gcc/config/rs6000/lynx.h
@@ -24,7 +24,6 @@
#undef PTRDIFF_TYPE
#undef WCHAR_TYPE
#undef WCHAR_TYPE_SIZE
-#undef ASM_FILE_START
#undef EXTRA_SECTIONS
#undef READONLY_DATA_SECTION
#undef READONLY_DATA_SECTION_ASM_OP
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 9c5df76c30d..051da0206a7 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -167,7 +167,6 @@ extern enum direction function_arg_padding PARAMS ((enum machine_mode, tree));
extern void optimization_options PARAMS ((int, int));
extern void rs6000_override_options PARAMS ((const char *));
-extern void rs6000_file_start PARAMS ((FILE *, const char *));
extern int direct_return PARAMS ((void));
extern union tree_node *rs6000_build_va_list PARAMS ((void));
extern int first_reg_to_save PARAMS ((void));
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 5f7b361c955..2e1ceef9129 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -51,6 +51,9 @@
#include "langhooks.h"
#include "reload.h"
#include "cfglayout.h"
+#if TARGET_XCOFF
+#include "xcoffout.h" /* get declarations of xcoff_*_section_name */
+#endif
#ifndef TARGET_NO_PROTOTYPE
#define TARGET_NO_PROTOTYPE 0
@@ -235,6 +238,7 @@ static void rs6000_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
static rtx rs6000_emit_set_long_const PARAMS ((rtx,
HOST_WIDE_INT, HOST_WIDE_INT));
+static void rs6000_file_start PARAMS ((void));
#if TARGET_ELF
static unsigned int rs6000_elf_section_type_flags PARAMS ((tree, const char *,
int));
@@ -259,6 +263,7 @@ static void rs6000_xcoff_select_rtx_section PARAMS ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT));
static const char * rs6000_xcoff_strip_name_encoding PARAMS ((const char *));
static unsigned int rs6000_xcoff_section_type_flags PARAMS ((tree, const char *, int));
+static void rs6000_xcoff_file_start PARAMS ((void));
static void rs6000_xcoff_file_end PARAMS ((void));
#endif
#if TARGET_MACHO
@@ -941,15 +946,22 @@ optimization_options (level, size)
/* Do anything needed at the start of the asm file. */
-void
-rs6000_file_start (file, default_cpu)
- FILE *file;
- const char *default_cpu;
+static void
+rs6000_file_start ()
{
size_t i;
char buffer[80];
const char *start = buffer;
struct rs6000_cpu_select *ptr;
+ const char *default_cpu = TARGET_CPU_DEFAULT;
+ FILE *file = asm_out_file;
+
+ default_file_start ();
+
+#ifdef TARGET_BI_ARCH
+ if ((TARGET_DEFAULT ^ target_flags) & MASK_64BIT)
+ default_cpu = 0;
+#endif
if (flag_verbose_asm)
{
@@ -14179,6 +14191,40 @@ rs6000_xcoff_section_type_flags (decl, name, reloc)
return flags | (exact_log2 (align) & SECTION_ENTSIZE);
}
+/* Output at beginning of assembler file.
+
+ Initialize the section names for the RS/6000 at this point.
+
+ Specify filename, including full path, to assembler.
+
+ We want to go into the TOC section so at least one .toc will be emitted.
+ Also, in order to output proper .bs/.es pairs, we need at least one static
+ [RW] section emitted.
+
+ Finally, declare mcount when profiling to make the assembler happy. */
+
+static void
+rs6000_xcoff_file_start ()
+{
+ rs6000_gen_section_name (&xcoff_bss_section_name,
+ main_input_filename, ".bss_");
+ rs6000_gen_section_name (&xcoff_private_data_section_name,
+ main_input_filename, ".rw_");
+ rs6000_gen_section_name (&xcoff_read_only_section_name,
+ main_input_filename, ".ro_");
+
+ fputs ("\t.file\t", asm_out_file);
+ output_quoted_string (asm_out_file, main_input_filename);
+ fputc ('\n', asm_out_file);
+ toc_section ();
+ if (write_symbols != NO_DEBUG)
+ private_data_section ();
+ text_section ();
+ if (profile_flag)
+ fprintf (asm_out_file, "\t.extern %s\n", RS6000_MCOUNT);
+ rs6000_file_start ();
+}
+
/* Output at end of assembler file.
On the RS/6000, referencing data should automatically pull in text. */
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 8d63a4fad3f..991e8889547 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -2429,6 +2429,8 @@ extern int toc_initialized;
} \
while (0)
+#define TARGET_ASM_FILE_START rs6000_file_start
+
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 098269831dd..822a4380f2e 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -710,16 +710,6 @@ do { \
|| (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
|| (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
-/* Output .file. */
-/* Override elfos.h definition. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- output_file_directive ((FILE), main_input_filename); \
- rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
-} while (0)
-
-
extern int fixuplabelno;
/* Handle constructors specially for -mrelocatable. */
diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h
index affe073dfa5..26d79ec17a1 100644
--- a/gcc/config/rs6000/xcoff.h
+++ b/gcc/config/rs6000/xcoff.h
@@ -108,9 +108,10 @@ toc_section () \
{ \
if (TARGET_MINIMAL_TOC) \
{ \
- /* toc_section is always called at least once from ASM_FILE_START, \
- so this is guaranteed to always be defined once and only once \
- in each file. */ \
+ /* toc_section is always called at least once \
+ from rs6000_xcoff_file_start, so this is \
+ guaranteed to always be defined once and \
+ only once in each file. */ \
if (! toc_initialized) \
{ \
fputs ("\t.toc\nLCTOC..1:\n", asm_out_file); \
@@ -200,40 +201,11 @@ toc_section () \
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP "\t.globl "
-/* Output at beginning of assembler file.
-
- Initialize the section names for the RS/6000 at this point.
-
- Specify filename, including full path, to assembler.
-
- We want to go into the TOC section so at least one .toc will be emitted.
- Also, in order to output proper .bs/.es pairs, we need at least one static
- [RW] section emitted.
-
- Finally, declare mcount when profiling to make the assembler happy. */
-
-#define ASM_FILE_START(FILE) \
-{ \
- rs6000_gen_section_name (&xcoff_bss_section_name, \
- main_input_filename, ".bss_"); \
- rs6000_gen_section_name (&xcoff_private_data_section_name, \
- main_input_filename, ".rw_"); \
- rs6000_gen_section_name (&xcoff_read_only_section_name, \
- main_input_filename, ".ro_"); \
- \
- fputs ("\t.file\t", FILE); \
- output_quoted_string (FILE, main_input_filename); \
- fputc ('\n', FILE); \
- toc_section (); \
- if (write_symbols != NO_DEBUG) \
- private_data_section (); \
- text_section (); \
- if (profile_flag) \
- fprintf (FILE, "\t.extern %s\n", RS6000_MCOUNT); \
- rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
-}
-
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START rs6000_xcoff_file_start
#define TARGET_ASM_FILE_END rs6000_xcoff_file_end
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE false
/* This macro produces the initial definition of a function name.
On the RS/6000, we need to place an extra '.' in the function name and
diff --git a/gcc/config/sh/elf.h b/gcc/config/sh/elf.h
index 6b2a6c98f83..57930829b51 100644
--- a/gcc/config/sh/elf.h
+++ b/gcc/config/sh/elf.h
@@ -19,6 +19,10 @@ 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. */
+/* Let sh.c know this is ELF. */
+#undef TARGET_ELF
+#define TARGET_ELF 1
+
/* Generate DWARF2 debugging information and make it the default */
#define DWARF2_DEBUGGING_INFO 1
@@ -43,21 +47,6 @@ Boston, MA 02111-1307, USA. */
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) do { \
- output_file_directive ((FILE), main_input_filename); \
-/* We also need to show the text section with the proper \
- attributes as in TEXT_SECTION_ASM_OP, before dwarf2out \
- emits it without attributes in TEXT_SECTION, else GAS \
- will complain. We can teach GAS specifically about the \
- default attributes for our choice of text section, but \
- then we would have to change GAS again if/when we change \
- the text section name. */ \
- fprintf ((FILE), "%s\n", TEXT_SECTION_ASM_OP); \
- if (TARGET_LITTLE_ENDIAN) \
- fprintf ((FILE), "\t.little\n"); \
-} while (0)
-
#undef SIZE_TYPE
#define SIZE_TYPE (TARGET_SH5 ? "long unsigned int" : "unsigned int")
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
index 95c18842c69..10ef2e4a591 100644
--- a/gcc/config/sh/sh-protos.h
+++ b/gcc/config/sh/sh-protos.h
@@ -111,7 +111,6 @@ extern tree sh_build_va_list PARAMS ((void));
extern const char *output_jump_label_table PARAMS ((void));
extern int sh_handle_pragma PARAMS ((int (*)(void), void (*)(int), const char *));
extern struct rtx_def *get_fpscr_rtx PARAMS ((void));
-extern void output_file_start PARAMS ((FILE *));
extern int sh_media_register_for_return PARAMS ((void));
extern void sh_expand_prologue PARAMS ((void));
extern void sh_expand_epilogue PARAMS ((void));
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 3dfa6eea2c4..1fca14fbc60 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -220,6 +220,7 @@ static void sh_media_init_builtins PARAMS ((void));
static rtx sh_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
static void sh_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
+static void sh_file_start PARAMS ((void));
static int flow_dependent_p PARAMS ((rtx, rtx));
static void flow_dependent_p_1 PARAMS ((rtx, rtx, void *));
static int shiftcosts PARAMS ((rtx));
@@ -259,6 +260,11 @@ static int shmedia_target_regs_stack_adjust (HARD_REG_SET *);
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START sh_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+
#undef TARGET_INSERT_ATTRIBUTES
#define TARGET_INSERT_ATTRIBUTES sh_insert_attributes
@@ -1302,26 +1308,38 @@ output_ieee_ccmpeq (insn, operands)
return output_branchy_insn (NE, "bt\t%l9\\;fcmp/eq\t%1,%0", insn, operands);
}
-/* Output to FILE the start of the assembler file. */
-
-void
-output_file_start (file)
- FILE *file;
-{
- output_file_directive (file, main_input_filename);
+/* Output the start of the assembler file. */
- /* Switch to the data section so that the coffsem symbol
- isn't in the text section. */
- data_section ();
+static void
+sh_file_start ()
+{
+ default_file_start ();
+
+ if (TARGET_ELF)
+ /* We need to show the text section with the proper
+ attributes as in TEXT_SECTION_ASM_OP, before dwarf2out
+ emits it without attributes in TEXT_SECTION, else GAS
+ will complain. We can teach GAS specifically about the
+ default attributes for our choice of text section, but
+ then we would have to change GAS again if/when we change
+ the text section name. */
+ fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
+ else
+ /* Switch to the data section so that the coffsem symbol
+ isn't in the text section. */
+ data_section ();
if (TARGET_LITTLE_ENDIAN)
- fprintf (file, "\t.little\n");
+ fputs ("\t.little\n", asm_out_file);
- if (TARGET_SHCOMPACT)
- fprintf (file, "\t.mode\tSHcompact\n");
- else if (TARGET_SHMEDIA)
- fprintf (file, "\t.mode\tSHmedia\n\t.abi\t%i\n",
- TARGET_SHMEDIA64 ? 64 : 32);
+ if (!TARGET_ELF)
+ {
+ if (TARGET_SHCOMPACT)
+ fputs ("\t.mode\tSHcompact\n", asm_out_file);
+ else if (TARGET_SHMEDIA)
+ fprintf (asm_out_file, "\t.mode\tSHmedia\n\t.abi\t%i\n",
+ TARGET_SHMEDIA64 ? 64 : 32);
+ }
}
/* Check if PAT includes UNSPEC_CALLER unspec pattern. */
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index ac5924fe59e..c74bb3ada28 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -152,6 +152,9 @@ extern int target_flags;
#define IEEE_BIT (1<<30)
#define SAVE_ALL_TR_BIT (1<<2)
+/* Nonzero if this is an ELF target - compile time only */
+#define TARGET_ELF 0
+
/* Nonzero if we should dump out instruction size info. */
#define TARGET_DUMPISIZE (target_flags & ISIZE_BIT)
@@ -2972,10 +2975,6 @@ while (0)
the end of the line. */
#define ASM_COMMENT_START "!"
-/* The text to go at the start of the assembler file. */
-#define ASM_FILE_START(STREAM) \
- output_file_start (STREAM)
-
#define ASM_APP_ON ""
#define ASM_APP_OFF ""
#define FILE_ASM_OP "\t.file\n"
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index fdbd0fdbaf6..872f224c8c5 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -2668,10 +2668,6 @@ do { \
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(file)
-
/* A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will end at
the end of the line. */
diff --git a/gcc/config/svr3.h b/gcc/config/svr3.h
index a4aa18958b7..21595eac273 100644
--- a/gcc/config/svr3.h
+++ b/gcc/config/svr3.h
@@ -29,13 +29,8 @@ Boston, MA 02111-1307, USA. */
/* Assembler, linker, library, and startfile spec's. */
-/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { output_file_directive ((FILE), main_input_filename); \
- } while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* This says how to output an assembler line
to define a global common symbol. */
diff --git a/gcc/config/v850/v850-protos.h b/gcc/config/v850/v850-protos.h
index f12e22a49af..f96abbd5c3e 100644
--- a/gcc/config/v850/v850-protos.h
+++ b/gcc/config/v850/v850-protos.h
@@ -35,7 +35,6 @@ extern void zdata_section PARAMS ((void));
extern void rozdata_section PARAMS ((void));
extern void zbss_section PARAMS ((void));
extern int v850_handle_pragma PARAMS ((int (*)(void), void (*)(int), char *));
-extern void asm_file_start PARAMS ((FILE *));
extern void override_options PARAMS ((void));
extern int compute_register_save_size PARAMS ((long *));
extern int compute_frame_size PARAMS ((int, long *));
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index e0fc724ecb0..4db79a99d3b 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -105,6 +105,9 @@ static int v850_interrupt_p = FALSE;
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO v850_encode_section_info
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS v850_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -159,15 +162,6 @@ override_options ()
}
-/* Output assembly code for the start of the file. */
-
-void
-asm_file_start (file)
- FILE *file;
-{
- output_file_directive (file, main_input_filename);
-}
-
/* Return an RTX to represent where a value with mode MODE will be returned
from a function. If the result is 0, the argument is pushed. */
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 68c0d3f4748..52e631334e5 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -1144,10 +1144,6 @@ zbss_section () \
#define ZCOMMON_ASM_OP "\t.zcomm\t"
#define TCOMMON_ASM_OP "\t.tcomm\t"
-/* Output at beginning/end of assembler file. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) asm_file_start(FILE)
-
#define ASM_COMMENT_START "#"
/* Output to assembler file text saying following lines
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 66b943be5f8..fea970e0eda 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -43,6 +43,7 @@ Boston, MA 02111-1307, USA. */
static int follows_p PARAMS ((rtx, rtx));
static void vax_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
+static void vax_file_start PARAMS ((void));
static void vax_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
static int vax_address_cost_1 PARAMS ((rtx));
@@ -57,6 +58,11 @@ static bool vax_rtx_costs PARAMS ((rtx, int, int, int *));
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE vax_output_function_prologue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START vax_file_start
+#undef TARGET_ASM_FILE_START_APP_OFF
+#define TARGET_ASM_FILE_START_APP_OFF true
+
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK vax_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -126,6 +132,18 @@ vax_output_function_prologue (file, size)
asm_fprintf (file, "\tsubl2 $%wd,%Rsp\n", size);
}
+/* When debugging with stabs, we want to output an extra dummy label
+ so that gas can distinguish between D_float and G_float prior to
+ processing the .stabs directive identifying type double. */
+static void
+vax_file_start ()
+{
+ default_file_start ();
+
+ if (write_symbols == DBX_DEBUG)
+ fprintf (asm_out_file, "___vax_%c_doubles:\n", ASM_DOUBLE_CHAR);
+}
+
/* This is like nonimmediate_operand with a restriction on the type of MEM. */
void
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 731a8bdc05b..bb1450dbb01 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -938,19 +938,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-/* When debugging, we want to output an extra dummy label so that gas
- can distinguish between D_float and G_float prior to processing the
- .stabs directive identifying type double. */
-
-#define ASM_FILE_START(FILE) \
- do { \
- fputs (ASM_APP_OFF, FILE); \
- if (write_symbols == DBX_DEBUG) \
- fprintf (FILE, "___vax_%c_doubles:\n", ASM_DOUBLE_CHAR); \
- } while (0)
-
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/vax/vaxv.h b/gcc/config/vax/vaxv.h
index 5e8c24987f0..c85cf4a8a2f 100644
--- a/gcc/config/vax/vaxv.h
+++ b/gcc/config/vax/vaxv.h
@@ -40,9 +40,7 @@ Boston, MA 02111-1307, USA. */
#undef LIB_SPEC
/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-output_file_directive ((FILE), main_input_filename)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 52697e157b6..670b5a237c2 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -6190,19 +6190,38 @@ instructions do.
@cindex output of assembler code
@c prevent bad page break with this line
-This describes the overall framework of an assembler file.
+This describes the overall framework of an assembly file.
+
+@deftypefn {Target Hook} void TARGET_ASM_FILE_START ()
+@findex default_file_start
+Output to @code{asm_out_file} any text which the assembler expects to
+find at the beginning of a file. The default behavior is controlled
+by two flags, documented below. Unless your target's assembler is
+quite unusual, if you override the default, you should call
+@code{default_file_start} at some point in your target hook. This
+lets other target files rely on these variables.
+@end deftypefn
-@table @code
-@findex ASM_FILE_START
-@item ASM_FILE_START (@var{stream})
-A C expression which outputs to the stdio stream @var{stream}
-some appropriate text to go at the start of an assembler file.
-
-Normally this macro is defined to output a line containing
-@samp{#NO_APP}, which is a comment that has no effect on most
-assemblers but tells the GNU assembler that it can save time by not
-checking for certain assembler constructs.
-@end table
+@deftypevr {Target Hook} bool TARGET_ASM_FILE_START_APP_OFF
+If this flag is true, the text of the macro @code{ASM_APP_OFF} will be
+printed as the very first line in the assembly file, unless
+@option{-fverbose-asm} is in effect. (If that macro has been defined
+to the empty string, this variable has no effect.) With the normal
+definition of @code{ASM_APP_OFF}, the effect is to notify the GNU
+assembler that it need not bother stripping comments or extra
+whitespace from its input. This allows it to work a bit faster.
+
+The default is false. You should not set it to true unless you have
+verified that your port does not generate any extra whitespace or
+comments that will cause GAS to issue errors in NO_APP mode.
+@end deftypevr
+
+@deftypevr {Target Hook} bool TARGET_ASM_FILE_START_FILE_DIRECTIVE
+If this flag is true, @code{output_file_directive} will be called
+for the primary source file, immediately after printing
+@code{ASM_APP_OFF} (if that is enabled). Most ELF assemblers expect
+this to be done. The default is false.
+@end deftypevr
@deftypefn {Target Hook} void TARGET_ASM_FILE_END ()
Output to @code{asm_out_file} any text which the assembler expects
diff --git a/gcc/output.h b/gcc/output.h
index 2bfc64d3a6b..aaaeaa2fe08 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -519,6 +519,7 @@ extern bool default_binds_local_p PARAMS ((tree));
extern bool default_binds_local_p_1 PARAMS ((tree, int));
extern void default_globalize_label PARAMS ((FILE *, const char *));
extern void default_internal_label PARAMS ((FILE *, const char *, unsigned long));
+extern void default_file_start PARAMS ((void));
extern void file_end_indicate_exec_stack PARAMS ((void));
extern bool default_valid_pointer_mode PARAMS ((enum machine_mode));
diff --git a/gcc/system.h b/gcc/system.h
index 3214f7aa2dd..cafaea68b43 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -598,7 +598,7 @@ typedef char _Bool;
WCHAR_UNSIGNED UNIQUE_SECTION SELECT_SECTION SELECT_RTX_SECTION \
ENCODE_SECTION_INFO STRIP_NAME_ENCODING ASM_GLOBALIZE_LABEL \
ASM_OUTPUT_MI_THUNK CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS \
- ADDRESS_COST MACHINE_DEPENDENT_REORG ASM_FILE_END
+ ADDRESS_COST MACHINE_DEPENDENT_REORG ASM_FILE_START ASM_FILE_END
/* Other obsolete target macros, or macros that used to be in target
headers and were not used, and may be obsolete or may never have
diff --git a/gcc/target-def.h b/gcc/target-def.h
index f339868f1c8..d6950e4b348 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -150,10 +150,22 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_ASM_EH_FRAME_SECTION default_eh_frame_section
#endif
+#ifndef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START default_file_start
+#endif
+
#ifndef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END hook_void_void
#endif
+#ifndef TARGET_ASM_FILE_START_APP_OFF
+#define TARGET_ASM_FILE_START_APP_OFF false
+#endif
+
+#ifndef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE false
+#endif
+
#define TARGET_ASM_ALIGNED_INT_OP \
{TARGET_ASM_ALIGNED_HI_OP, \
TARGET_ASM_ALIGNED_SI_OP, \
@@ -189,6 +201,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_ASM_DESTRUCTOR, \
TARGET_ASM_OUTPUT_MI_THUNK, \
TARGET_ASM_CAN_OUTPUT_MI_THUNK, \
+ TARGET_ASM_FILE_START, \
TARGET_ASM_FILE_END}
/* Scheduler hooks. All of these default to null pointers, which
@@ -329,7 +342,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_HAVE_CTORS_DTORS, \
TARGET_HAVE_TLS, \
TARGET_HAVE_SRODATA_SECTION, \
- TARGET_TERMINATE_DW2_EH_FRAME_INFO \
+ TARGET_TERMINATE_DW2_EH_FRAME_INFO, \
+ TARGET_ASM_FILE_START_APP_OFF, \
+ TARGET_ASM_FILE_START_FILE_DIRECTIVE, \
}
#include "hooks.h"
diff --git a/gcc/target.h b/gcc/target.h
index d6e30e3a469..4ba369d7d3e 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -143,7 +143,12 @@ struct gcc_target
HOST_WIDE_INT vcall_offset,
tree function_decl));
- /* Output any boilerplate text needed at the end of a translation unit. */
+ /* Output any boilerplate text needed at the beginning of a
+ translation unit. */
+ void (*file_start) PARAMS ((void));
+
+ /* Output any boilerplate text needed at the end of a
+ translation unit. */
void (*file_end) PARAMS ((void));
} asm_out;
@@ -368,6 +373,14 @@ struct gcc_target
/* True if EH frame info sections should be zero-terminated. */
bool terminate_dw2_eh_frame_info;
+
+ /* True if #NO_APP should be emitted at the beginning of
+ assembly output. */
+ bool file_start_app_off;
+
+ /* True if output_file_directive should be called for main_input_filename
+ at the beginning of assembly output. */
+ bool file_start_file_directive;
};
extern struct gcc_target targetm;
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 259765f8e86..602ce6ff098 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -4819,9 +4819,7 @@ init_asm_output (const char *name)
if (!flag_syntax_only)
{
-#ifdef ASM_FILE_START
- ASM_FILE_START (asm_out_file);
-#endif
+ targetm.asm_out.file_start ();
#ifdef ASM_COMMENT_START
if (flag_verbose_asm)
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 6879559d4bf..a76d23ae1cb 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -5363,6 +5363,18 @@ default_internal_label (stream, prefix, labelno)
ASM_OUTPUT_LABEL (stream, buf);
}
+/* This is the default behavior at the beginning of a file. It's
+ controlled by two other target-hook toggles. */
+void
+default_file_start ()
+{
+ if (targetm.file_start_app_off && !flag_verbose_asm)
+ fputs (ASM_APP_OFF, asm_out_file);
+
+ if (targetm.file_start_file_directive)
+ output_file_directive (asm_out_file, main_input_filename);
+}
+
/* This is a generic routine suitable for use as TARGET_ASM_FILE_END
which emits a special section directive used to indicate whether or
not this object file needs an executable stack. This is primarily
diff --git a/gcc/xcoffout.h b/gcc/xcoffout.h
index dd630c93749..8e41770d43e 100644
--- a/gcc/xcoffout.h
+++ b/gcc/xcoffout.h
@@ -138,8 +138,8 @@ extern const char *xcoff_lastfile;
/* Write out main source file name using ".file" rather than ".stabs".
We don't actually do this here, because the assembler gets confused if there
- is more than one .file directive. ASM_FILE_START in config/rs6000/rs6000.h
- is already emitting a .file directory, so we don't output one here also.
+ is more than one .file directive. rs6000_xcoff_file_start is already
+ emitting a .file directory, so we don't output one here also.
Initialize xcoff_lastfile. */
#define DBX_OUTPUT_MAIN_SOURCE_FILENAME(FILE,FILENAME) \
xcoff_lastfile = (FILENAME)