+2003-06-07 Zack Weinberg <zack@codesourcery.com>
+
+ * config.gcc (with_cpu handling): Translate sparc64 in
+ $machine to --with-cpu=v9.
+ * config/alpha/alpha.c
+ (TARGET_ASM_GLOBALIZE_LABEL [TARGET_ABI_UNICOSMK]): Correct definition.
+ (alpha_setup_incoming_varargs): #ifdef out when TARGET_ABI_UNICOSMK.
+
+ * target.h: New hook asm_out.file_end.
+ * target.h: Update to match. New hook macro TARGET_ASM_FILE_END.
+ * toplev.c (compile_file: Use targetm.asm_out.file_end.
+ * system.h: Poison ASM_FILE_END.
+ * varasm.c (file_end_indicate_exec_stack): New.
+ * output.h: Prototype it.
+ * doc/tm.texi: Document TARGET_ASM_FILE_END and
+ file_end_indicate_exec_stack. Delete references to attasm.h.
+
+ * config/darwin.h (TARGET_ASM_FILE_END): Reset to darwin_file_end.
+ (ASM_FILE_END): Delete; move code...
+ * config/darwin.c (darwin_file_end): Here; new function.
+ * config/darwin-protos.h: Prototype it.
+ * config/alpha/alpha.c (unicosmk_asm_file_end): Make static,
+ rename unicosmk_file_end.
+ * config/arm/aof.h (ASM_FILE_END): Delete; move code...
+ * config/arm/arm.c (aof_file_end): ... here; new static function.
+ Set TARGET_ASM_FILE_END to aof_file_end if AOF_ASSEMBLER.
+ Make aof_dump_imports and aof_dump_pic_table static.
+ * config/avr/avr.c (asm_file_end): Rename avr_file_end, make static.
+ Set TARGET_ASM_FILE_END to avr_file_end.
+ * config/c4x/c4x.c (c4x_file_end): Make static. Take no arguments.
+ Set TARGET_ASM_FILE_END to c4x_file_end.
+ * config/h8300/h8300.c (asm_file_end): Rename h8300_file_end,
+ make static. Take no arguments. Set TARGET_ASM_FILE_END to
+ h8300_file_end.
+ * config/i370/i370.h (ASM_FILE_END): Delete; move code...
+ * config/i370/i370.c (i370_file_end): ... here; new static function.
+ Set TARGET_ASM_FILE_END to i370_file_end.
+ * config/i386/i386.c (ix86_asm_file_end): Rename ix86_file_end.
+ Take no arguments. Call file_end_indicate_exec_stack if
+ NEED_INDICATE_EXEC_STACK; don't use SUBTARGET_FILE_END.
+ * config/i386/i386.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END.
+ Define NEED_INDICATE_EXEC_STACK to 0.
+ * config/i386/linux.h, config/i386/linux64.h: Redefine
+ NEED_INDICATE_EXEC_STACK to 1 instead of setting SUBTARGET_FILE_END.
+ * config/i386/winnt.c (i386_pe_asm_file_end): Rename to
+ i386_pe_file_end. Take no arguments. Use ix86_file_end.
+ * config/ia64/ia64.c (ia64_hpux_asm_file_end): Rename to
+ ia64_hpux_file_end, make static. Take no arguments.
+ * config/ip2k/ip2k.c (asm_file_start, asm_file_end,
+ commands_in_prologues, commands_in_epilogues): Delete.
+ (function_epilogue): Update to match.
+ * config/mips/mips.c (mips_asm_file_end): Rename mips_file_end,
+ make static. Take no arguments.
+ (iris6_asm_file_end): Rename iris6_file_end, make static, use
+ mips_file_end, take no arguments.
+ Set TARGET_ASM_FILE_END to iris6_file_end or mips_file_end as
+ appropriate.
+ * config/mmix/mmix.c (mmix_asm_file_end): Rename mmix_file_end,
+ make static, take no arguments. Set TARGET_ASM_FILE_END to
+ mmix_file_end.
+ * config/pa/pa.c (output_deferred_plabels): Make static, take
+ no arguments. Set TARGET_ASM_FILE_END to output_deferred_plabels.
+ * config/rs6000/xcoff.h (TARGET_ASM_FILE_END): Set it.
+ (ASM_FILE_END): Delete; move code...
+ * config/rs6000/rs6000.c (rs6000_xcoff_file_end): ... here;
+ new static function.
+
+ * config/avr/avr.h, config/cris/cris.h, config/h8300/h8300.h
+ * config/mmix/mmix.h, config/mips/iris6.h, config/mips/mips.h:
+ Don't set ASM_FILE_END.
+ * config/alpha/linux-elf.h, config/m68k/linux.h, config/rs6000/linux.h
+ * config/rs6000/linux64.h, config/s390/linux.h, config/sparc/linux.h
+ * config/sparc/linux64.h: Set TARGET_ASM_FILE_END to
+ file_end_indicate_exec_stack; don't set ASM_FILE_END.
+ * config/alpha/unicosmk.h, config/i386/cygming.h
+ * config/ia64/hpux.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END.
+ * config/arm/arm-protos.h, config/alpha/alpha-protos.h
+ * config/avr/avr-protos.h, config/c4x/c4x-protos.h
+ * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h
+ * config/ip2k/ip2k-protos.h, config/mips/mips-protos.h
+ * config/mmix/mmix-protos.h, config/pa/pa-protos.h: Update.
+
Sat Jun 7 18:32:13 CEST 2003 Jan Hubicka <jh@suse.cz>
* i386.h (OPTION_DEFAULT_SPECS): Avoid -mcpu default when -march is
2003-06-05 Nick Clifton <nickc@redhat.com>
* config.gcc (m32r-elf): Revert previous delta.
- * config/m32r/t-m32r (crtinit.o): Fix rule to work with
- multilibs. Remove m32rx specific version.
- (crtfini.o): Likewise.
- (EXTRA_MULTILIB_PARTS): Define.
+ * config/m32r/t-m32r (crtinit.o): Fix rule to work with
+ multilibs. Remove m32rx specific version.
+ (crtfini.o): Likewise.
+ (EXTRA_MULTILIB_PARTS): Define.
2003-06-05 Eric Botcazou <ebotcazou@libertysurf.fr>
constraints related to floating-point registers on SPARC.
2003-06-05 Eric Botcazou <ebotcazou@libertysurf.fr>
- Paolo Bonzini <bonzini@gnu.org>
+ Paolo Bonzini <bonzini@gnu.org>
PR target/10663
* configure.in (HAVE_LD_RO_RW_SECTION_MIXING): Redirect
;;
sparc*-*-*)
with_cpu="`echo $machine | sed 's/-.*$//'`"
+ if [ x$with_cpu = xsparc64 ]; then
+ with_cpu=v9
+ fi
;;
esac
fi
extern char * unicosmk_text_section PARAMS ((void));
extern char * unicosmk_data_section PARAMS ((void));
extern void unicosmk_asm_file_start PARAMS ((FILE *));
-extern void unicosmk_asm_file_end PARAMS ((FILE *));
extern void unicosmk_output_common PARAMS ((FILE *, const char *, int, int));
#endif /* TARGET_ABI_UNICOSMK */
static void unicosmk_gen_dsib PARAMS ((unsigned long *imaskP));
static void unicosmk_output_ssib PARAMS ((FILE *, const char *));
static int unicosmk_need_dex PARAMS ((rtx));
+static void unicosmk_file_end PARAMS ((void));
/* Get the number of args of a function in one of two ways. */
#if TARGET_ABI_OPEN_VMS || TARGET_ABI_UNICOSMK
# undef TARGET_ASM_UNIQUE_SECTION
# define TARGET_ASM_UNIQUE_SECTION unicosmk_unique_section
# undef TARGET_ASM_GLOBALIZE_LABEL
-# define TARGET_ASM_GLOBALIZE_LABEL hook_FILEptr_constcharptr_void
+# define TARGET_ASM_GLOBALIZE_LABEL hook_void_FILEptr_constcharptr
#endif
#undef TARGET_ASM_ALIGNED_HI_OP
not the most efficient way to implement varargs with just one register
class, but it isn't worth doing anything more efficient in this rare
case. */
-
+#ifndef TARGET_ABI_UNICOSMK
void
alpha_setup_incoming_varargs(cum, mode, type, pretend_size, no_rtl)
CUMULATIVE_ARGS cum;
}
*pretend_size = 12 * UNITS_PER_WORD;
}
+#endif
void
alpha_va_start (valist, nextarg)
/* Output text to appear at the end of an assembler file. This includes all
pending extern declarations and DEX expressions. */
-void
-unicosmk_asm_file_end (file)
- FILE *file;
+static void
+unicosmk_file_end ()
{
- fputs ("\t.endp\n\n", file);
+ fputs ("\t.endp\n\n", asm_out_file);
/* Output all pending externs. */
- unicosmk_output_externs (file);
+ unicosmk_output_externs (asm_out_file);
/* Output dex definitions used for functions whose names conflict with
register names. */
- unicosmk_output_dex (file);
+ unicosmk_output_dex (asm_out_file);
- fputs ("\t.end\t", file);
- unicosmk_output_module_name (file);
- putc ('\n', file);
+ fputs ("\t.end\t", asm_out_file);
+ unicosmk_output_module_name (asm_out_file);
+ putc ('\n', asm_out_file);
}
/* Output the definition of a common variable. */
x = XEXP (x, 0);
if (GET_CODE (x) != SYMBOL_REF)
abort ();
- fnname = default_name_encoding (XSTR (x, 0));
+ fnname = XSTR (x, 0);
len = strlen (fnname);
if (len + SSIB_PREFIX_LEN > 255)
#define LIB_SPEC \
"%{pthread:-lpthread} %{shared:-lc}%{!shared:%{profile:-lc_p}%{!profile:-lc}} "
-#define ASM_FILE_END(FILE) \
- do { \
- named_section_flags (".note.GNU-stack", \
- SECTION_DEBUG \
- | (trampolines_created ? SECTION_CODE : 0)); \
- } while (0)
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
/* This outputs text to go at the end of an assembler file. */
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE) unicosmk_asm_file_end (FILE)
+#define TARGET_ASM_FILE_END unicosmk_file_end
/* We take care of that in ASM_FILE_START. */
#define NAME__MAIN "__gccmain"
#define SYMBOL__MAIN __gccmain
-#define ASM_FILE_END(STREAM) \
-do \
-{ \
- if (flag_pic) \
- aof_dump_pic_table (STREAM); \
- aof_dump_imports (STREAM); \
- fputs ("\tEND\n", (STREAM)); \
-} while (0);
-
#define ASM_COMMENT_START ";"
#define ASM_APP_ON ""
#if defined AOF_ASSEMBLER
extern rtx aof_pic_entry PARAMS ((rtx));
-extern void aof_dump_pic_table PARAMS ((FILE *));
extern char * aof_text_section PARAMS ((void));
extern char * aof_data_section PARAMS ((void));
extern void aof_add_import PARAMS ((const char *));
extern void aof_delete_import PARAMS ((const char *));
-extern void aof_dump_imports PARAMS ((FILE *));
extern void zero_init_section PARAMS ((void));
extern void common_section PARAMS ((void));
#endif /* AOF_ASSEMBLER */
#endif
#ifdef AOF_ASSEMBLER
static void aof_globalize_label PARAMS ((FILE *, Ccstar));
+static void aof_dump_imports PARAMS ((FILE *));
+static void aof_dump_pic_table PARAMS ((FILE *));
+static void aof_file_end PARAMS ((void));
#endif
#undef Hint
#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_END
+#define TARGET_ASM_FILE_END aof_file_end
#else
#undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP NULL
int arm_main_function = 0;
-void
+static void
aof_dump_imports (f)
FILE * f;
{
if (! strcmp (name, "main"))
arm_main_function = 1;
}
+
+static void
+aof_file_end ()
+{
+ if (flag_pic)
+ aof_dump_pic_table (asm_out_file);
+ aof_dump_imports (asm_out_file);
+ fputs ("\tEND\n", asm_out_file);
+}
#endif /* AOF_ASSEMBLER */
#ifdef OBJECT_FORMAT_ELF
extern int function_arg_regno_p PARAMS ((int r));
extern void asm_file_start PARAMS ((FILE *file));
-extern void asm_file_end 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));
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_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));
static void avr_unique_section PARAMS ((tree, int));
#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER avr_assemble_integer
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END avr_file_end
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE avr_output_function_prologue
/* Outputs to the stdio stream FILE some
appropriate text to go at the end of an assembler file. */
-void
-asm_file_end (file)
- FILE *file;
+static void
+avr_file_end ()
{
- fputs ("/* File ", file);
- output_quoted_string (file, main_input_filename);
- fprintf (file,
+ fputs ("/* File ", asm_out_file);
+ output_quoted_string (asm_out_file, main_input_filename);
+ fprintf (asm_out_file,
": code %4d = 0x%04x (%4d), prologues %3d, epilogues %3d */\n",
commands_in_file,
commands_in_file,
On systems that use SDB, it is necessary to output certain
commands; see `attasm.h'. */
-#define ASM_FILE_END(STREAM) asm_file_end (STREAM)
-/* A C expression which outputs to the stdio stream STREAM some
- appropriate text to go at the end of an assembler file.
-
- If this macro is not defined, the default is to output nothing
- special at the end of the file. Most systems don't require any
- definition.
-
- 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
extern void c4x_external_ref (const char *);
-extern void c4x_file_end (FILE *);
-
#ifdef TREE_CODE
extern void c4x_function_arg_advance PARAMS ((CUMULATIVE_ARGS *,
enum machine_mode, tree, int));
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_end PARAMS ((void));
static void c4x_check_attribute PARAMS ((const char *, tree, tree, tree *));
static int c4x_r11_set_p PARAMS ((rtx));
static int c4x_rptb_valid_p PARAMS ((rtx, 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_END
+#define TARGET_ASM_FILE_END c4x_file_end
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE c4x_attribute_table
}
-void
-c4x_file_end (fp)
- FILE *fp;
+static void
+c4x_file_end ()
{
struct name_list *p;
p = extern_head;
while (p)
{
- fprintf (fp, "\t.ref\t");
- assemble_name (fp, p->name);
- fprintf (fp, "\n");
+ fprintf (asm_out_file, "\t.ref\t");
+ assemble_name (asm_out_file, p->name);
+ fprintf (asm_out_file, "\n");
p = p->next;
}
- fprintf (fp, "\t.end\n");
+ fprintf (asm_out_file, "\t.end\n");
}
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
c4x_external_ref (XSTR (FUN, 0))
-#define ASM_FILE_END(FILE) \
-c4x_file_end (FILE)
-
/* The prefix to add to user-visible assembler symbols. */
#define USER_LABEL_PREFIX "_"
} \
while (0)
-/* Override previous definitions (elfos.h). */
-#undef ASM_FILE_END
-#define ASM_FILE_END(STREAM)
-
/* 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. */
extern void darwin_pragma_options PARAMS ((struct cpp_reader *));
extern void darwin_pragma_unused PARAMS ((struct cpp_reader *));
+extern void darwin_file_end PARAMS ((void));
+
/* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o. */
extern void const_section PARAMS ((void));
extern void const_data_section PARAMS ((void));
fprintf (file, "\n\t.long L$set$%d", darwin_dwarf_label_counter++);
}
+void
+darwin_file_end ()
+{
+ machopic_finish (asm_out_file);
+ if (strcmp (lang_hooks.name, "GNU C++") == 0)
+ {
+ constructor_section ();
+ destructor_section ();
+ ASM_OUTPUT_ALIGN (asm_out_file, 1);
+ }
+}
+
#include "gt-darwin.h"
#undef ASM_FILE_START
#define ASM_FILE_START(FILE)
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE) \
- do { \
- machopic_finish (asm_out_file); \
- if (strcmp (lang_hooks.name, "GNU C++") == 0) \
- { \
- constructor_section (); \
- destructor_section (); \
- ASM_OUTPUT_ALIGN (FILE, 1); \
- } \
- } while (0)
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END darwin_file_end
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
fprintf (FILE, "\t.space "HOST_WIDE_INT_PRINT_UNSIGNED"\n", SIZE)
extern void h8300_expand_epilogue PARAMS ((void));
extern int h8300_current_function_interrupt_function_p PARAMS ((void));
extern void asm_file_start PARAMS ((FILE *));
-extern void asm_file_end PARAMS ((FILE *));
extern int h8300_initial_elimination_offset PARAMS ((int, int));
struct cpp_reader;
static tree h8300_handle_tiny_data_attribute PARAMS ((tree *, tree, tree, int, bool *));
static void h8300_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static void h8300_insert_attributes PARAMS ((tree, tree *));
+static void h8300_file_end PARAMS ((void));
#ifndef OBJECT_FORMAT_ELF
static void h8300_asm_named_section PARAMS ((const char *, unsigned int));
#endif
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE h8300_output_function_epilogue
+
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END h8300_file_end
+
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO h8300_encode_section_info
/* Output assembly language code for the end of file. */
-void
-asm_file_end (file)
- FILE *file;
+static void
+h8300_file_end ()
{
- fprintf (file, "\t.end\n");
+ fputs ("\t.end\n", asm_out_file);
}
\f
/* Return true if OP is a valid source operand for an integer move
#define ASM_FILE_START(FILE) asm_file_start (FILE)
-#define ASM_FILE_END(FILE) asm_file_end (FILE)
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
#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_end PARAMS ((void));
+
#ifdef LONGEXTERNAL
static int mvs_hash_alias PARAMS ((const char *));
#endif
#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_END
+#define TARGET_ASM_FILE_END i370_file_end
#undef TARGET_ASM_INTERNAL_LABEL
#define TARGET_ASM_INTERNAL_LABEL i370_internal_label
#undef TARGET_RTX_COSTS
fprintf (file, "\tDC\tA(PG%d)\n", i);
}
+static void
+i370_file_end ()
+{
+ fputs ("\tEND\n", asm_out_file);
+}
+
static void
i370_internal_label (stream, prefix, labelno)
FILE *stream;
{ fputs ("\tRMODE\tANY\n", FILE); \
fputs ("\tCSECT\n", FILE); }
-#define ASM_FILE_END(FILE) fputs ("\tEND\n", FILE);
#define ASM_COMMENT_START "*"
#define ASM_APP_OFF ""
#define ASM_APP_ON ""
asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
/* Output function declarations at the end of the file. */
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE) \
- i386_pe_asm_file_end (FILE)
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END i386_pe_file_end
#undef ASM_COMMENT_START
#define ASM_COMMENT_START " #"
extern void i386_pe_record_external_function PARAMS ((const char *));
extern void i386_pe_declare_function_type PARAMS ((FILE *, const char *, int));
extern void i386_pe_record_exported_symbol PARAMS ((const char *, int));
-extern void i386_pe_asm_file_end PARAMS ((FILE *));
+extern void i386_pe_file_end PARAMS ((void));
extern int i386_pe_dllexport_name_p PARAMS ((const char *));
extern int i386_pe_dllimport_name_p PARAMS ((const char *));
extern int ix86_frame_pointer_required PARAMS ((void));
extern void ix86_setup_frame_addresses PARAMS ((void));
-extern void ix86_asm_file_end PARAMS ((FILE *));
+extern void ix86_file_end PARAMS ((void));
extern HOST_WIDE_INT ix86_initial_elimination_offset PARAMS((int, int));
extern void ix86_expand_prologue PARAMS ((void));
extern void ix86_expand_epilogue PARAMS ((int));
the return address of the caller and then returns. */
void
-ix86_asm_file_end (file)
- FILE *file;
+ix86_file_end ()
{
rtx xops[2];
int regno;
(*targetm.asm_out.unique_section) (decl, 0);
named_section (decl, NULL, 0);
- (*targetm.asm_out.globalize_label) (file, name);
- fputs ("\t.hidden\t", file);
- assemble_name (file, name);
- fputc ('\n', file);
- ASM_DECLARE_FUNCTION_NAME (file, name, decl);
+ (*targetm.asm_out.globalize_label) (asm_out_file, name);
+ fputs ("\t.hidden\t", asm_out_file);
+ assemble_name (asm_out_file, name);
+ fputc ('\n', asm_out_file);
+ ASM_DECLARE_FUNCTION_NAME (asm_out_file, name, decl);
}
else
{
text_section ();
- ASM_OUTPUT_LABEL (file, name);
+ ASM_OUTPUT_LABEL (asm_out_file, name);
}
xops[0] = gen_rtx_REG (SImode, regno);
output_asm_insn ("ret", xops);
}
-#ifdef SUBTARGET_FILE_END
- SUBTARGET_FILE_END (file);
-#endif
+ if (NEED_INDICATE_EXEC_STACK)
+ file_end_indicate_exec_stack ();
}
/* Emit code for the SET_GOT patterns. */
#define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \
ix86_va_arg ((VALIST), (TYPE))
-/* This macro is invoked at the end of compilation. It is used here to
- output code for -fpic that will load the return address into %ebx. */
-
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE) ix86_asm_file_end (FILE)
+#define TARGET_ASM_FILE_END ix86_file_end
+#define NEED_INDICATE_EXEC_STACK 0
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
: "=d"(BASE))
#endif
-#define SUBTARGET_FILE_END(FILE) \
- do { \
- named_section_flags (".note.GNU-stack", \
- SECTION_DEBUG \
- | (trampolines_created ? SECTION_CODE : 0)); \
- } while (0)
+#undef NEED_INDICATE_EXEC_STACK
+#define NEED_INDICATE_EXEC_STACK 1
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
#define MULTILIB_DEFAULTS { "m64" }
-#define SUBTARGET_FILE_END(FILE) \
- do { \
- named_section_flags (".note.GNU-stack", \
- SECTION_DEBUG \
- | (trampolines_created ? SECTION_CODE : 0)); \
- } while (0)
+#undef NEED_INDICATE_EXEC_STACK
+#define NEED_INDICATE_EXEC_STACK 1
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs.
output the .drectve section. */
void
-i386_pe_asm_file_end (file)
- FILE *file;
+i386_pe_file_end ()
{
struct extern_list *p;
- ix86_asm_file_end (file);
+ ix86_file_end ();
for (p = extern_head; p != NULL; p = p->next)
{
if (! TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (decl))
{
TREE_ASM_WRITTEN (decl) = 1;
- i386_pe_declare_function_type (file, p->name, TREE_PUBLIC (decl));
+ i386_pe_declare_function_type (asm_out_file, p->name,
+ TREE_PUBLIC (decl));
}
}
drectve_section ();
for (q = export_head; q != NULL; q = q->next)
{
- fprintf (file, "\t.ascii \" -export:%s%s\"\n",
+ fprintf (asm_out_file, "\t.ascii \" -export:%s%s\"\n",
i386_pe_strip_name_encoding (q->name),
(q->is_data) ? ",data" : "");
}
/* Put out the needed function declarations at the end. */
-#define ASM_FILE_END(STREAM) ia64_hpux_asm_file_end(STREAM)
+#define TARGET_ASM_FILE_END ia64_hpux_file_end
#undef CTORS_SECTION_ASM_OP
#define CTORS_SECTION_ASM_OP "\t.section\t.init_array,\t\"aw\",\"init_array\""
#endif /* ARGS_SIZE_RTX */
extern void ia64_hpux_handle_builtin_pragma PARAMS ((struct cpp_reader *));
-extern void ia64_hpux_asm_file_end PARAMS ((FILE *));
static void ia64_hpux_add_extern_decl PARAMS ((const char *name))
ATTRIBUTE_UNUSED;
+static void ia64_hpux_file_end PARAMS ((void))
+ ATTRIBUTE_UNUSED;
+
\f
/* Table of valid machine attributes. */
static const struct attribute_spec ia64_attribute_table[] =
/* Print out the list of used global functions. */
-void
-ia64_hpux_asm_file_end (file)
- FILE *file;
+static void
+ia64_hpux_file_end ()
{
while (extern_func_head)
{
{
if (decl)
TREE_ASM_WRITTEN (decl) = 1;
- (*targetm.asm_out.globalize_label) (file, extern_func_head->name);
- fprintf (file, "%s", TYPE_ASM_OP);
- assemble_name (file, extern_func_head->name);
- putc (',', file);
- fprintf (file, TYPE_OPERAND_FMT, "function");
- putc ('\n', file);
+ (*targetm.asm_out.globalize_label) (asm_out_file,
+ extern_func_head->name);
+ fputs (TYPE_ASM_OP, asm_out_file);
+ assemble_name (asm_out_file, extern_func_head->name);
+ putc (',', asm_out_file);
+ fprintf (asm_out_file, TYPE_OPERAND_FMT, "function");
+ putc ('\n', asm_out_file);
}
extern_func_head = extern_func_head->next;
}
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-extern void asm_file_start PARAMS ((FILE *));
-extern void asm_file_end PARAMS ((FILE *));
-
extern void function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
extern void function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
extern int find_one_set_bit_p PARAMS ((HOST_WIDE_INT));
struct gcc_target targetm = TARGET_INITIALIZER;
-/* Commands in the functions prologues in the compiled file. */
-static int commands_in_prologues;
-
-/* Commands in the functions epilogues in the compiled file. */
-static int commands_in_epilogues;
-
/* Prologue/Epilogue size in words. */
static int prologue_size;
static int epilogue_size;
}
fprintf (file, "/* epilogue end (size=%d) */\n", epilogue_size);
- commands_in_prologues += prologue_size;
- commands_in_epilogues += epilogue_size;
}
\f
/* Return the difference between the registers after the function
return NULL_TREE;
}
-/* Outputs to the stdio stream FILE some
- appropriate text to go at the start of an assembler file. */
-
-void
-asm_file_start (file)
- FILE *file;
-{
- output_file_directive (file, main_input_filename);
-
- commands_in_prologues = 0;
- commands_in_epilogues = 0;
-}
-
-/* Outputs to the stdio stream FILE some
- appropriate text to go at the end of an assembler file. */
-
-void
-asm_file_end (file)
- FILE *file;
-{
- fprintf
- (file,
- "/* File %s: prologues %3d, epilogues %3d */\n",
- main_input_filename, commands_in_prologues, commands_in_epilogues);
-}
-
/* Cost functions. */
/* Compute a (partial) cost for rtx X. Return true if the complete
: "%d0", "%d2", "%d3"); \
}
-#define ASM_FILE_END(FILE) \
- do { \
- named_section_flags (".note.GNU-stack", \
- SECTION_DEBUG \
- | (trampolines_created ? SECTION_CODE : 0)); \
- } while (0)
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
#define ASM_OUTPUT_ALIGN iris6_asm_output_align
#undef ASM_FILE_START
#define ASM_FILE_START iris6_asm_file_start
-#undef ASM_FILE_END
-#define ASM_FILE_END iris6_asm_file_end
#undef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT (32768*8)
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_end PARAMS ((FILE *));
extern void mips_asm_file_start PARAMS ((FILE *));
extern void iris6_asm_file_start PARAMS ((FILE *));
-extern void iris6_asm_file_end 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));
static int iris_section_align_entry_eq PARAMS ((const PTR, const PTR));
static hashval_t iris_section_align_entry_hash PARAMS ((const PTR));
static int iris6_section_align_1 PARAMS ((void **, void *));
+static void iris6_file_end PARAMS ((void));
#endif
static int mips_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static int mips_issue_rate 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_end PARAMS ((void));
/* Structure to be filled in by compute_frame_size with register
save masks, and offsets for the current function. */
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG mips_reorg
+#undef TARGET_ASM_FILE_END
+#ifdef TARGET_IRIX6
+#define TARGET_ASM_FILE_END iris6_file_end
+#else
+#define TARGET_ASM_FILE_END mips_file_end
+#endif
+
struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* If X is one of the constants described by mips_constant_type,
warning if the data area is more than 32K and -pic because 3 instructions
are needed to reference the data pointers. */
-void
-mips_asm_file_end (file)
- FILE *file;
+static void
+mips_file_end ()
{
tree name_tree;
struct extern_list *p;
if (extern_head)
{
- fputs ("\n", file);
+ fputs ("\n", asm_out_file);
for (p = extern_head; p != 0; p = p->next)
{
TREE_ASM_WRITTEN (name_tree) = 1;
#ifdef ASM_OUTPUT_UNDEF_FUNCTION
if (p->size == -1)
- ASM_OUTPUT_UNDEF_FUNCTION (file, p->name);
+ ASM_OUTPUT_UNDEF_FUNCTION (asm_out_file, p->name);
else
#endif
{
- fputs ("\t.extern\t", file);
- assemble_name (file, p->name);
- fprintf (file, ", %d\n", p->size);
+ fputs ("\t.extern\t", asm_out_file);
+ assemble_name (asm_out_file, p->name);
+ fprintf (asm_out_file, ", %d\n", p->size);
}
}
}
if (TARGET_FILE_SWITCHING)
{
- fprintf (file, "\n\t.text\n");
- copy_file_data (file, asm_out_text_file);
+ fputs ("\n\t.text\n", asm_out_file);
+ copy_file_data (asm_out_file, asm_out_text_file);
}
}
}
/* Emit either a label, .comm, or .lcomm directive, and mark that the symbol
- is used, so that we don't emit an .extern for it in mips_asm_file_end. */
+ is used, so that we don't emit an .extern for it in mips_file_end. */
void
mips_declare_object (stream, name, init_string, final_string, size)
return 1;
}
-void
-iris6_asm_file_end (stream)
- FILE *stream;
+static void
+iris6_file_end ()
{
/* Emit section directives with the proper alignment at the top of the
real output file. */
+ FILE *temp = asm_out_file;
asm_out_file = iris_orig_asm_out_file;
htab_traverse (iris_section_align_htab, iris6_section_align_1, NULL);
/* Copy the data emitted to the temp file to the real output file. */
- copy_file_data (asm_out_file, stream);
+ copy_file_data (asm_out_file, temp);
- mips_asm_file_end (stream);
+ mips_file_end ();
}
#endif /* TARGET_IRIX6 */
#define ASM_OUTPUT_EXTERNAL(STREAM,DECL,NAME) \
mips_output_external(STREAM,DECL,NAME)
-/* This says what to print at the end of the assembly file */
-#undef ASM_FILE_END
-#define ASM_FILE_END(STREAM) mips_asm_file_end(STREAM)
-
-
/* Play switch file games if we're optimizing the global pointer. */
#undef TEXT_SECTION
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_file_end 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));
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_end PARAMS ((void));
static bool mmix_rtx_costs
PARAMS ((rtx, int, int, int *));
#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_END
+#define TARGET_ASM_FILE_END mmix_file_end
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS mmix_rtx_costs
text_section ();
}
-/* ASM_FILE_END. */
+/* TARGET_ASM_FILE_END. */
-void
-mmix_asm_file_end (stream)
- FILE * stream ATTRIBUTE_UNUSED;
+static void
+mmix_file_end ()
{
/* Make sure each file ends with the data section. */
data_section ();
#define ASM_FILE_START(STREAM) \
mmix_asm_file_start (STREAM)
-#define ASM_FILE_END(STREAM) \
- mmix_asm_file_end (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
extern struct rtx_def *hppa_builtin_saveregs PARAMS ((void));
-extern void output_deferred_plabels PARAMS ((FILE *));
extern void override_options PARAMS ((void));
extern void output_ascii PARAMS ((FILE *, const char *, int));
extern int compute_frame_size PARAMS ((int, int *));
static int length_fp_args PARAMS ((rtx)) ATTRIBUTE_UNUSED;
static struct deferred_plabel *get_plabel PARAMS ((const char *))
ATTRIBUTE_UNUSED;
+static void output_deferred_plabels PARAMS ((void));
/* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */
static GTY((length ("n_deferred_plabels"))) struct deferred_plabel *
deferred_plabels;
static size_t n_deferred_plabels = 0;
+
\f
/* Initialize the GCC target structure. */
#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_END
+#define TARGET_ASM_FILE_END output_deferred_plabels
+
#if !defined(USE_COLLECT2)
#undef TARGET_ASM_CONSTRUCTOR
#define TARGET_ASM_CONSTRUCTOR pa_asm_out_constructor
return &deferred_plabels[i];
}
-void
-output_deferred_plabels (file)
- FILE *file;
+static void
+output_deferred_plabels ()
{
size_t i;
/* If we have deferred plabels, then we need to switch into the data
if (n_deferred_plabels)
{
data_section ();
- ASM_OUTPUT_ALIGN (file, TARGET_64BIT ? 3 : 2);
+ ASM_OUTPUT_ALIGN (asm_out_file, TARGET_64BIT ? 3 : 2);
}
/* Now output the deferred plabels. */
for (i = 0; i < n_deferred_plabels; i++)
{
- (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (deferred_plabels[i].internal_label));
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
+ CODE_LABEL_NUMBER (deferred_plabels[i].internal_label));
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, deferred_plabels[i].name),
TARGET_64BIT ? 8 : 4, TARGET_64BIT ? 64 : 32, 1);
}
#define ASM_APP_OFF ""
-/* Output deferred plabels at the end of the file. */
-
-#define ASM_FILE_END(FILE) output_deferred_plabels (FILE)
-
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
/* We don't need to generate entries in .fixup. */
#undef RELOCATABLE_NEEDS_FIXUP
-#define ASM_FILE_END(FILE) \
- do { \
- named_section_flags (".note.GNU-stack", \
- SECTION_DEBUG \
- | (trampolines_created ? SECTION_CODE : 0)); \
- } while (0)
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
#undef DRAFT_V4_STRUCT_RET
#define DRAFT_V4_STRUCT_RET (!TARGET_64BIT)
-#define ASM_FILE_END(FILE) \
- do { \
- if (! TARGET_64BIT) \
- named_section_flags (".note.GNU-stack", \
- SECTION_DEBUG \
- | (trampolines_created ? SECTION_CODE : 0)); \
- } while (0)
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
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_end PARAMS ((void));
#endif
#if TARGET_MACHO
static bool rs6000_binds_local_p PARAMS ((tree));
return flags | (exact_log2 (align) & SECTION_ENTSIZE);
}
+
+/* Output at end of assembler file.
+ On the RS/6000, referencing data should automatically pull in text. */
+
+static void
+rs6000_xcoff_file_end ()
+{
+ text_section ();
+ fputs ("_section_.text:\n", asm_out_file);
+ data_section ();
+ fputs (TARGET_32BIT
+ ? "\t.long _section_.text\n" : "\t.llong _section_.text\n",
+ asm_out_file);
+}
#endif /* TARGET_XCOFF */
#if TARGET_MACHO
rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
}
-/* Output at end of assembler file.
-
- On the RS/6000, referencing data should automatically pull in text. */
-
-#define ASM_FILE_END(FILE) \
-{ \
- text_section (); \
- fputs ("_section_.text:\n", FILE); \
- data_section (); \
- fputs (TARGET_32BIT \
- ? "\t.long _section_.text\n" : "\t.llong _section_.text\n", FILE); \
-}
+#define TARGET_ASM_FILE_END rs6000_xcoff_file_end
/* 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
{ "link_arch31", LINK_ARCH31_SPEC }, \
{ "link_arch64", LINK_ARCH64_SPEC }, \
-#define ASM_FILE_END(FILE) \
- do { \
- named_section_flags (".note.GNU-stack", \
- SECTION_DEBUG \
- | (trampolines_created ? SECTION_CODE : 0)); \
- } while (0)
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
-#define ASM_FILE_END(FILE) \
- do { \
- named_section_flags (".note.GNU-stack", \
- SECTION_DEBUG \
- | (trampolines_created ? SECTION_CODE : 0)); \
- } while (0)
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
-#define ASM_FILE_END(FILE) \
- do { \
- named_section_flags (".note.GNU-stack", \
- SECTION_DEBUG \
- | (trampolines_created ? SECTION_CODE : 0)); \
- } while (0)
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
@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
-On systems that use SDB, it is necessary to output certain commands;
-see @file{attasm.h}.
-
-@findex ASM_FILE_END
-@item ASM_FILE_END (@var{stream})
-A C expression which outputs to the stdio stream @var{stream}
-some appropriate text to go at the end of an assembler file.
-
-If this macro is not defined, the default is to output nothing
-special at the end of the file. Most systems don't require any
-definition.
+@deftypefn {Target Hook} void TARGET_ASM_FILE_END ()
+Output to @code{asm_out_file} any text which the assembler expects
+to find at the end of a file. The default is to output nothing.
+@end deftypefn
-On systems that use SDB, it is necessary to output certain commands;
-see @file{attasm.h}.
+@deftypefun void file_end_indicate_exec_stack ()
+Some systems use a common convention, the @samp{.note.GNU-stack}
+special section, to indicate whether or not an object file relies on
+the stack being executable. If your system uses this convention, you
+should define @code{TARGET_ASM_FILE_END} to this function. If you
+need to do other things in that hook, have your hook function call
+this function.
+@end deftypefun
+@table @code
@findex ASM_COMMENT_START
@item ASM_COMMENT_START
A C string constant describing how to begin a comment in the target
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 file_end_indicate_exec_stack PARAMS ((void));
extern bool default_valid_pointer_mode PARAMS ((enum machine_mode));
/* Emit data for vtable gc for GNU binutils. */
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
+ ADDRESS_COST MACHINE_DEPENDENT_REORG 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
#define TARGET_ASM_EH_FRAME_SECTION default_eh_frame_section
#endif
+#ifndef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END hook_void_void
+#endif
+
#define TARGET_ASM_ALIGNED_INT_OP \
{TARGET_ASM_ALIGNED_HI_OP, \
TARGET_ASM_ALIGNED_SI_OP, \
TARGET_ASM_CONSTRUCTOR, \
TARGET_ASM_DESTRUCTOR, \
TARGET_ASM_OUTPUT_MI_THUNK, \
- TARGET_ASM_CAN_OUTPUT_MI_THUNK }
+ TARGET_ASM_CAN_OUTPUT_MI_THUNK, \
+ TARGET_ASM_FILE_END}
/* Scheduler hooks. All of these default to null pointers, which
haifa-sched.c looks for and handles. */
HOST_WIDE_INT delta,
HOST_WIDE_INT vcall_offset,
tree function_decl));
+
+ /* Output any boilerplate text needed at the end of a translation unit. */
+ void (*file_end) PARAMS ((void));
} asm_out;
/* Functions relating to instruction scheduling. */
timevar_pop (TV_DUMP);
}
-#ifdef ASM_FILE_END
- ASM_FILE_END (asm_out_file);
-#endif
+ targetm.asm_out.file_end ();
/* Attach a special .ident directive to the end of the file to identify
the version of GCC which compiled this code. The format of the .ident
ASM_OUTPUT_LABEL (stream, buf);
}
+/* 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
+ a GNU extension to ELF but could be used on other targets. */
+void
+file_end_indicate_exec_stack ()
+{
+ unsigned int flags = SECTION_DEBUG;
+ if (trampolines_created)
+ flags |= SECTION_CODE;
+
+ named_section_flags (".note.GNU-stack", flags);
+}
+
#include "gt-varasm.h"