* alpha/elf.h (ASM_OUTPUT_EXTERNAL_LIBCALL,
ASM_OUTPUT_ALIGNED_BSS): Use target hook.
* alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS): Likewise.
* alpha/unicosmk.h (ASM_GLOBALIZE_LABEL): Delete.
* arm/aof.h (ASM_GLOBALIZE_LABEL): Likewise.
(GLOBAL_ASM_OP): Define.
* arm.c (aof_globalize_label): New function.
(TARGET_ASM_GLOBALIZE_LABEL): Define for AOF.
* arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook.
* c4x.c (c4x_globalize_label): New function.
(TARGET_ASM_GLOBALIZE_LABEL): Define for c4x.
* c4x.h (ASM_GLOBALIZE_LABEL): Delete.
(GLOBAL_ASM_OP): Define.
* cris/aout.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook.
* darwin-protos.h (darwin_globalize_label): Declare.
* darwin.c (darwin_globalize_label): New function.
* darwin.h (ASM_DECLARE_CLASS_REFERENCE): Use target hook.
(ASM_GLOBALIZE_LABEL): Delete.
(GLOBAL_ASM_OP, TARGET_ASM_GLOBALIZE_LABEL): Define.
* dsp16xx.c (asm_output_common): Use target hook.
* elfos.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise.
* frv.h (ASM_GLOBALIZE_LABEL): Delete.
(GLOBAL_ASM_OP): Define.
* i370.c (i370_globalize_label): New function.
(TARGET_ASM_GLOBALIZE_LABEL): Define for i370.
* i370.h (ASM_GLOBALIZE_LABEL): Delete.
* i386.c (ix86_asm_file_end): Use target hook.
* i386/sco5.h (ASM_GLOBALIZE_LABEL): Don't undef.
(ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook.
* ia64.c (ia64_asm_output_external): Likewise.
* ia64/sysv4.h: Update comment.
* m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook.
* mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
* mips/iris5.h (ASM_OUTPUT_WEAK_ALIAS): Use target hook.
* mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
* mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use target hook.
* mmix-protos.h (mmix_asm_globalize_label): Delete.
* mmix.c (mmix_asm_globalize_label): Likewise.
* mmix.h (ASM_GLOBALIZE_LABEL): Likewise.
(GLOBAL_ASM_OP): Define.
* ns32k.c (ns32k_globalize_label): New function.
* ns32k.h (TARGET_ASM_GLOBALIZE_LABEL): Define for ns32k.
(ASM_GLOBALIZE_LABEL): Delete.
* pa/pa-linux.h (ASM_GLOBALIZE_LABEL): Don't undef.
(TARGET_ASM_GLOBALIZE_LABEL): Undefine.
* pa.c (pa_globalize_label): New function.
* pa.h (ASM_GLOBALIZE_LABEL): Delete.
(TARGET_ASM_GLOBALIZE_LABEL): Define for pa.
* rs6000/darwin.h (ASM_GLOBALIZE_LABEL): Delete.
(GLOBAL_ASM_OP): Define.
(TARGET_ASM_GLOBALIZE_LABEL): Undef.
* rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook.
* rs6000/xcoff.h (ASM_GLOBALIZE_LABEL): Delete.
(GLOBAL_ASM_OP): Define.
* v850.c (v850_output_aligned_bss): Use target hook.
* vax.c (vms_globalize_label): New function.
(TARGET_ASM_GLOBALIZE_LABEL): Define for vms.
* vax/vms.h (ASM_GLOBALIZE_LABEL): Delete.
(GLOBAL_ASM_OP): Define.
* defaults.h (ASM_GLOBALIZE_LABEL): Delete.
* doc/tm.texi: Update docs.
* dwarf2out.c (default_eh_frame_section, output_die_symbol): Use
target hook.
* final.c (output_alternate_entry_point): Likewise.
* hooks.c (hook_FILEptr_constcharptr_void): New function.
* hooks.h (hook_FILEptr_constcharptr_void): Declare.
* output.h (assemble_global): Delete.
(default_globalize_label): Declare.
* system.h (ASM_GLOBALIZE_LABEL): Poison.
* target-def.h (TARGET_ASM_GLOBALIZE_LABEL): Define.
(TARGET_ASM_OUT): Add TARGET_ASM_GLOBALIZE_LABEL.
* target.h (gcc_target): Add globalize_label member.
* varasm.c (asm_output_bss, asm_output_aligned_bss,
globalize_decl): Use target hook.
(assemble_global): Delete.
(default_globalize_label): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56478
138bc75d-0d04-0410-961f-
82ee72b054a4
2002-08-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ * alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk.
+ * alpha/elf.h (ASM_OUTPUT_EXTERNAL_LIBCALL,
+ ASM_OUTPUT_ALIGNED_BSS): Use target hook.
+ * alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS): Likewise.
+ * alpha/unicosmk.h (ASM_GLOBALIZE_LABEL): Delete.
+ * arm/aof.h (ASM_GLOBALIZE_LABEL): Likewise.
+ (GLOBAL_ASM_OP): Define.
+ * arm.c (aof_globalize_label): New function.
+ (TARGET_ASM_GLOBALIZE_LABEL): Define for AOF.
+ * arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook.
+ * c4x.c (c4x_globalize_label): New function.
+ (TARGET_ASM_GLOBALIZE_LABEL): Define for c4x.
+ * c4x.h (ASM_GLOBALIZE_LABEL): Delete.
+ (GLOBAL_ASM_OP): Define.
+ * cris/aout.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook.
+ * darwin-protos.h (darwin_globalize_label): Declare.
+ * darwin.c (darwin_globalize_label): New function.
+ * darwin.h (ASM_DECLARE_CLASS_REFERENCE): Use target hook.
+ (ASM_GLOBALIZE_LABEL): Delete.
+ (GLOBAL_ASM_OP, TARGET_ASM_GLOBALIZE_LABEL): Define.
+ * dsp16xx.c (asm_output_common): Use target hook.
+ * elfos.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise.
+ * frv.h (ASM_GLOBALIZE_LABEL): Delete.
+ (GLOBAL_ASM_OP): Define.
+ * i370.c (i370_globalize_label): New function.
+ (TARGET_ASM_GLOBALIZE_LABEL): Define for i370.
+ * i370.h (ASM_GLOBALIZE_LABEL): Delete.
+ * i386.c (ix86_asm_file_end): Use target hook.
+ * i386/sco5.h (ASM_GLOBALIZE_LABEL): Don't undef.
+ (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook.
+ * ia64.c (ia64_asm_output_external): Likewise.
+ * ia64/sysv4.h: Update comment.
+ * m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook.
+ * mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
+ * mips/iris5.h (ASM_OUTPUT_WEAK_ALIAS): Use target hook.
+ * mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
+ * mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use target hook.
+ * mmix-protos.h (mmix_asm_globalize_label): Delete.
+ * mmix.c (mmix_asm_globalize_label): Likewise.
+ * mmix.h (ASM_GLOBALIZE_LABEL): Likewise.
+ (GLOBAL_ASM_OP): Define.
+ * ns32k.c (ns32k_globalize_label): New function.
+ * ns32k.h (TARGET_ASM_GLOBALIZE_LABEL): Define for ns32k.
+ (ASM_GLOBALIZE_LABEL): Delete.
+ * pa/pa-linux.h (ASM_GLOBALIZE_LABEL): Don't undef.
+ (TARGET_ASM_GLOBALIZE_LABEL): Undefine.
+ * pa.c (pa_globalize_label): New function.
+ * pa.h (ASM_GLOBALIZE_LABEL): Delete.
+ (TARGET_ASM_GLOBALIZE_LABEL): Define for pa.
+ * rs6000/darwin.h (ASM_GLOBALIZE_LABEL): Delete.
+ (GLOBAL_ASM_OP): Define.
+ (TARGET_ASM_GLOBALIZE_LABEL): Undef.
+ * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook.
+ * rs6000/xcoff.h (ASM_GLOBALIZE_LABEL): Delete.
+ (GLOBAL_ASM_OP): Define.
+ * v850.c (v850_output_aligned_bss): Use target hook.
+ * vax.c (vms_globalize_label): New function.
+ (TARGET_ASM_GLOBALIZE_LABEL): Define for vms.
+ * vax/vms.h (ASM_GLOBALIZE_LABEL): Delete.
+ (GLOBAL_ASM_OP): Define.
+ * defaults.h (ASM_GLOBALIZE_LABEL): Delete.
+ * doc/tm.texi: Update docs.
+ * dwarf2out.c (default_eh_frame_section, output_die_symbol): Use
+ target hook.
+ * final.c (output_alternate_entry_point): Likewise.
+ * hooks.c (hook_FILEptr_constcharptr_void): New function.
+ * hooks.h (hook_FILEptr_constcharptr_void): Declare.
+ * output.h (assemble_global): Delete.
+ (default_globalize_label): Declare.
+ * system.h (ASM_GLOBALIZE_LABEL): Poison.
+ * target-def.h (TARGET_ASM_GLOBALIZE_LABEL): Define.
+ (TARGET_ASM_OUT): Add TARGET_ASM_GLOBALIZE_LABEL.
+ * target.h (gcc_target): Add globalize_label member.
+ * varasm.c (asm_output_bss, asm_output_aligned_bss,
+ globalize_decl): Use target hook.
+ (assemble_global): Delete.
+ (default_globalize_label): New function.
+
+2002-08-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
* dsp16xx.h (dsp16xx_umulhi3_libcall): Delete.
2002-08-20 Devang Patel <dpatel@apple.com>
# define TARGET_SECTION_TYPE_FLAGS unicosmk_section_type_flags
# 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
#endif
#undef TARGET_ASM_ALIGNED_HI_OP
#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
- ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+ (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0))
/* This says how to output assembler code to declare an
uninitialized external linkage data object. Under SVR4,
#undef ASM_OUTPUT_ALIGNED_BSS
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
do { \
- ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ (*targetm.asm_out.globalize_label) (FILE, NAME); \
ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
} while (0)
#define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE) \
do \
{ \
- ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ (*targetm.asm_out.globalize_label) (FILE, NAME); \
fputs ("\t.weakext\t", FILE); \
assemble_name (FILE, NAME); \
if (VALUE) \
#undef ASM_OUTPUT_SOURCE_FILENAME
-/* There is no directive for declaring a label as global. Instead, an
- additional colon must be appended when the label is defined. */
-
-#undef ASM_GLOBALIZE_LABEL
-#define ASM_GLOBALIZE_LABEL(FILE,NAME)
-
/* This is how to output a label for a jump table. Arguments are the same as
for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is
passed. */
extern int arm_main_function;
-#define ASM_GLOBALIZE_LABEL(STREAM,NAME) \
-do { \
- fprintf ((STREAM), "\tEXPORT\t"); \
- assemble_name ((STREAM), (NAME)); \
- fputc ('\n', (STREAM)); \
- if ((NAME)[0] == 'm' && ! strcmp ((NAME), "main")) \
- arm_main_function = 1; \
-} while (0)
+/* Globalizing directive for a label. */
+#define GLOBAL_ASM_OP "\tEXPORT\t"
#define ASM_OUTPUT_LABEL(STREAM,NAME) \
do { \
#ifndef ARM_PE
static void arm_encode_section_info PARAMS ((tree, int));
#endif
+#ifdef AOF_ASSEMBLER
+static void aof_globalize_label PARAMS ((FILE *, const char *));
+#endif
#undef Hint
#undef Mmode
#define TARGET_ASM_ALIGNED_HI_OP "\tDCW\t"
#undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP "\tDCD\t"
+#undef TARGET_ASM_GLOBALIZE_LABEL
+#define TARGET_ASM_GLOBALIZE_LABEL aof_globalize_label
#else
#undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP NULL
imports_list = imports_list->next;
}
}
+
+static void
+aof_globalize_label (stream, name)
+ FILE *stream;
+ const char *name;
+{
+ default_globalize_label (stream, name);
+ if (! strcmp (name, "main"))
+ arm_main_function = 1;
+}
#endif /* AOF_ASSEMBLER */
#ifdef OBJECT_FORMAT_ELF
else \
bss_section (); \
\
- ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ (*targetm.asm_out.globalize_label) (FILE, NAME); \
\
ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
\
static void c4x_asm_named_section PARAMS ((const char *, unsigned int));
static int c4x_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static void c4x_encode_section_info PARAMS ((tree, int));
+static void c4x_globalize_label PARAMS ((FILE *, const char *));
\f
/* Initialize the GCC target structure. */
#undef TARGET_ASM_BYTE_OP
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO c4x_encode_section_info
+#undef TARGET_ASM_GLOBALIZE_LABEL
+#define TARGET_ASM_GLOBALIZE_LABEL c4x_globalize_label
+
struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Override command line options.
fprintf (asm_out_file, "\t.sect\t\"%s\"\n", name);
}
+static void
+c4x_globalize_label (stream, name)
+ FILE *stream;
+ const char *name;
+{
+ default_globalize_label (stream, name);
+ c4x_global_label (name);
+}
#define NO_DOT_IN_LABEL /* Only required for TI format. */
-#define ASM_GLOBALIZE_LABEL(FILE, NAME) \
- do { \
- fprintf (FILE, "\t.global\t"); \
- assemble_name (FILE, NAME); \
- fputs ("\n", FILE); \
- c4x_global_label (NAME); \
- } while (0);
+/* Globalizing directive for a label. */
+#define GLOBAL_ASM_OP "\t.global\t"
#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
c4x_external_ref (NAME)
#define SET_ASM_OP "\t.set\t"
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
- ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+ (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0))
#define ASM_WEAKEN_LABEL(FILE, NAME) \
do \
extern void machopic_picsymbol_stub_section PARAMS ((void));
extern void darwin_exception_section PARAMS ((void));
extern void darwin_eh_frame_section PARAMS ((void));
+extern void darwin_globalize_label PARAMS ((FILE *, const char *));
fprintf (asm_out_file, ".reference .destructors_used\n");
}
+void
+darwin_globalize_label (stream, name)
+ FILE *stream;
+ const char *name;
+{
+ if (!!strncmp (name, "_OBJC_", 6))
+ default_globalize_label (stream, name);
+}
+
#include "gt-darwin.h"
fprintf (FILE, "\t"); \
assemble_name (FILE, NAME); \
fprintf (FILE, "=0\n"); \
- assemble_global (NAME); \
+ (*targetm.asm_out.globalize_label) (FILE, NAME); \
} \
} while (0)
-#undef ASM_GLOBALIZE_LABEL
-#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
- do { const char *const _x = (NAME); if (!!strncmp (_x, "_OBJC_", 6)) { \
- (fputs (".globl ", FILE), assemble_name (FILE, _x), fputs ("\n", FILE)); \
- }} while (0)
+/* Globalizing directive for a label. */
+#define GLOBAL_ASM_OP ".globl "
+#define TARGET_ASM_GLOBALIZE_LABEL darwin_globalize_label
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
int rounded;
{
bss_section ();
- ASM_GLOBALIZE_LABEL (file, name);
+ (*targetm.asm_out.globalize_label) (file, name);
assemble_name (file, name);
fputs (":", file);
if (rounded > 1)
in each assembly file where they are referenced. */
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
- ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+ (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0))
/* This says how to output assembler code to declare an
uninitialized external linkage data object. Under SVR4,
fputs (":\n", STREAM); \
} while (0)
-/* A C statement (sans semicolon) to output to the stdio stream STREAM some
- commands that will make the label NAME global; that is, available for
- reference from other files. Use the expression `assemble_name (STREAM,
- NAME)' to output the name itself; before and after that, output the
- additional assembler syntax for making that name global, and a newline. */
-#define ASM_GLOBALIZE_LABEL(STREAM, NAME) \
-do { \
- fputs ("\t.globl ", STREAM); \
- assemble_name (STREAM, NAME); \
- fputs ("\n", STREAM); \
-} while (0)
+/* Globalizing directive for a label. */
+#define GLOBAL_ASM_OP "\t.globl "
/* A C statement (sans semicolon) to output to the stdio stream STREAM a
reference in assembler syntax to a label named NAME. This should add `_' to
static void i370_label_scan PARAMS ((void));
#ifdef TARGET_HLASM
static bool i370_hlasm_assemble_integer PARAMS ((rtx, unsigned int, int));
+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));
#define TARGET_ASM_ALIGNED_SI_OP NULL
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER i370_hlasm_assemble_integer
+#undef TARGET_ASM_GLOBALIZE_LABEL
+#define TARGET_ASM_GLOBALIZE_LABEL i370_globalize_label
#endif
#undef TARGET_ASM_FUNCTION_PROLOGUE
/* find all labels in this routine */
i370_label_scan ();
}
+
+static void
+i370_globalize_label (stream, name)
+ FILE *stream;
+ const char *name;
+{
+ char temp[MAX_MVS_LABEL_SIZE + 1];
+ if (mvs_check_alias (name, temp) == 2)
+ fprintf (stream, "%s\tALIAS\tC'%s'\n", temp, name);
+ fputs ("\tENTRY\t", stream);
+ assemble_name (stream, name);
+ putc ('\n', stream);
+}
#endif /* TARGET_HLASM */
} \
}
-#define ASM_GLOBALIZE_LABEL(FILE, NAME) \
-{ \
- char temp[MAX_MVS_LABEL_SIZE + 1]; \
- if (mvs_check_alias (NAME, temp) == 2) \
- { \
- fprintf (FILE, "%s\tALIAS\tC'%s'\n", temp, NAME); \
- } \
- fputs ("\tENTRY\t", FILE); \
- assemble_name (FILE, NAME); \
- fputs ("\n", FILE); \
-}
-
/* MVS externals are limited to 8 characters, upper case only.
The '_' is mapped to '@', except for MVS functions, then '#'. */
(*targetm.asm_out.unique_section) (decl, 0);
named_section (decl, NULL, 0);
- ASM_GLOBALIZE_LABEL (file, name);
+ (*targetm.asm_out.globalize_label) (file, name);
fputs ("\t.hidden\t", file);
assemble_name (file, name);
fputc ('\n', file);
#define ASM_OUTPUT_IDENT(FILE, NAME) \
fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
-#undef ASM_GLOBALIZE_LABEL
-
#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
- if (TARGET_ELF) ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
+ if (TARGET_ELF) (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0))
#undef ASM_OUTPUT_INTERNAL_LABEL
#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
save_referenced = TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl));
if (TREE_CODE (decl) == FUNCTION_DECL)
ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function");
- ASM_GLOBALIZE_LABEL (file, name);
+ (*targetm.asm_out.globalize_label) (file, name);
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) = save_referenced;
}
\f
the Intel simulator. So we must explicitly put variables in .bss
instead. This matters only if we care about the Intel assembler. */
-/* This is asm_output_aligned_bss from varasm.c without the ASM_GLOBALIZE_LABEL
- call at the beginning. */
+/* This is asm_output_aligned_bss from varasm.c without the
+ (*targetm.asm_out.globalize_label) call at the beginning. */
/* This is for final.c, because it is used by ASM_DECLARE_OBJECT_NAME. */
extern int size_directive_output;
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
do \
{ \
- ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ (*targetm.asm_out.globalize_label) (FILE, NAME); \
ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
} \
while (0)
#ifndef ASM_OUTPUT_ALIGNED_BSS
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
do { \
- ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ (*targetm.asm_out.globalize_label) (FILE, NAME); \
if (SIZE > 0 && SIZE <= mips_section_threshold) \
sbss_section (); \
else \
#define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE) \
do \
{ \
- ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ (*targetm.asm_out.globalize_label) (FILE, NAME); \
fputs ("\t.weakext\t", FILE); \
assemble_name (FILE, NAME); \
if (VALUE) \
`varasm.c' when defining this macro. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
do { \
- ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ (*targetm.asm_out.globalize_label) (FILE, NAME); \
if (SIZE > 0 && SIZE <= mips_section_threshold) \
sbss_section (); \
else \
|| DECL_INITIAL (DECL) == error_mark_node)) \
{ \
if (TREE_PUBLIC (DECL) && DECL_NAME (DECL)) \
- ASM_GLOBALIZE_LABEL (STREAM, NAME); \
+ (*targetm.asm_out.globalize_label) (STREAM, NAME); \
\
readonly_data_section (); \
ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \
extern void mmix_asm_output_source_line PARAMS ((FILE *, int));
extern void mmix_asm_output_ascii PARAMS ((FILE *, const char *, int));
extern void mmix_asm_output_label PARAMS ((FILE *, const char *));
-extern void mmix_asm_globalize_label PARAMS ((FILE *, const char *));
extern void mmix_asm_weaken_label PARAMS ((FILE *, const char *));
extern void mmix_asm_output_labelref PARAMS ((FILE *, const char *));
extern void mmix_asm_output_internal_label
here. */
}
-/* ASM_GLOBALIZE_LABEL. */
-
-void
-mmix_asm_globalize_label (stream, name)
- FILE * stream ATTRIBUTE_UNUSED;
- const char * name ATTRIBUTE_UNUSED;
-{
- asm_fprintf (stream, "\t.global ");
- assemble_name (stream, name);
- putc ('\n', stream);
-}
-
/* ASM_WEAKEN_LABEL. */
void
#define ASM_DECLARE_REGISTER_GLOBAL(STREAM, DECL, REGNO, NAME) \
mmix_asm_declare_register_global (STREAM, DECL, REGNO, NAME)
-#define ASM_GLOBALIZE_LABEL(STREAM, NAME) \
- mmix_asm_globalize_label (STREAM, NAME)
+#define GLOBAL_ASM_OP "\t.global "
#define ASM_WEAKEN_LABEL(STREAM, NAME) \
mmix_asm_weaken_label (STREAM, NAME)
static void ns32k_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void ns32k_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static void ns32k_encode_section_info PARAMS ((tree, int));
+#ifdef COLLECT
+static void ns32k_globalize_label PARAMS ((FILE *, const char *));
+#endif
\f
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
|| ! TREE_PUBLIC (decl));
}
}
+
+#ifdef COLLECT
+static void
+ns32k_globalize_label (stream, name)
+ FILE *stream;
+ const char *name;
+{
+ fprintf (stream, "\t.globl\t%s\n", name);
+}
+#endif
/* This is how to output a command to make the user-level label named NAME
defined for reference from other files. */
-#ifndef COLLECT
+#ifdef COLLECT
+#define TARGET_ASM_GLOBALIZE_LABEL ns32k_globalize_label
+#else
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP ".globl "
-#else
-#define ASM_GLOBALIZE_LABEL(STREAM,NAME) \
- fprintf ((STREAM), "\t.globl\t%s\n", (NAME));
#endif
/* This is how to output an internal numbered label where
ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */
/* Use the default. */
-#undef ASM_GLOBALIZE_LABEL
+#undef TARGET_ASM_GLOBALIZE_LABEL
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP ".globl "
ATTRIBUTE_UNUSED;
static void pa_encode_section_info PARAMS ((tree, int));
static const char *pa_strip_name_encoding PARAMS ((const char *));
+static void pa_globalize_label PARAMS ((FILE *, const char *));
/* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */
data_section ();
}
+static void
+pa_globalize_label (stream, name)
+ FILE *stream;
+ const char *name;
+{
+ /* We only handle DATA objects here, functions are globalized in
+ ASM_DECLARE_FUNCTION_NAME. */
+ if (! FUNCTION_NAME_P (name))
+ {
+ fputs ("\t.EXPORT ", stream);
+ assemble_name (stream, name);
+ fputs (",DATA\n", stream);
+ }
+}
#include "gt-pa.h"
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf (LABEL, "*%c$%s%04ld", (PREFIX)[0], (PREFIX) + 1, (long)(NUM))
-#define ASM_GLOBALIZE_LABEL(FILE, NAME) \
- do { \
- /* We only handle DATA objects here, functions are globalized in \
- ASM_DECLARE_FUNCTION_NAME. */ \
- if (! FUNCTION_NAME_P (NAME)) \
- { \
- fputs ("\t.EXPORT ", FILE); \
- assemble_name (FILE, NAME); \
- fputs (",DATA\n", FILE); \
- } \
- } while (0)
+#define TARGET_ASM_GLOBALIZE_LABEL pa_globalize_label
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
output_ascii ((FILE), (P), (SIZE))
#define RS6000_OUTPUT_BASENAME(FILE, NAME) \
assemble_name (FILE, NAME);
-/* This is how to output a command to make the user-level label named NAME
- defined for reference from other files. */
-
-#undef ASM_GLOBALIZE_LABEL
-#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
- do { fputs ("\t.globl ", FILE); \
- RS6000_OUTPUT_BASENAME (FILE, NAME); putc ('\n', FILE);} while (0)
+/* Globalizing directive for a label. */
+#undef GLOBAL_ASM_OP
+#define GLOBAL_ASM_OP "\t.globl "
+#undef TARGET_ASM_GLOBALIZE_LABEL
/* This is how to output an internal label prefix. rs6000.c uses this
when generating traceback tables. */
/* Describe how to emit uninitialized external linkage items. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
do { \
- ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ (*targetm.asm_out.globalize_label) (FILE, NAME); \
ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
} while (0)
/* This is how to output a command to make the user-level label named NAME
defined for reference from other files. */
-#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
- do { fputs ("\t.globl ", FILE); \
- RS6000_OUTPUT_BASENAME (FILE, NAME); putc ('\n', FILE);} while (0)
+/* Globalizing directive for a label. */
+#define GLOBAL_ASM_OP "\t.globl "
/* Output at beginning of assembler file.
int size;
int align;
{
- ASM_GLOBALIZE_LABEL (file, name);
+ (*targetm.asm_out.globalize_label) (file, name);
switch (v850_get_data_area (decl))
{
static void vms_asm_out_destructor PARAMS ((rtx, int));
static void vms_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT));
static void vms_encode_section_info PARAMS ((tree, int));
+static void vms_globalize_label PARAMS ((FILE *, const char *));
#endif
\f
/* Initialize the GCC target structure. */
#define TARGET_ASM_SELECT_SECTION vms_select_section
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO vms_encode_section_info
+#undef TARGET_ASM_GLOBALIZE_LABEL
+#define TARGET_ASM_GLOBALIZE_LABEL vms_globalize_label
#endif
struct gcc_target targetm = TARGET_INITIALIZER;
if (DECL_EXTERNAL (decl) && TREE_PUBLIC (decl))
SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
}
+
+/* This is how to output a command to make the user-level label named NAME
+ defined for reference from other files. */
+static void
+vms_globalize_label (stream, name)
+ FILE *stream;
+ const char *name;
+{
+ default_globalize_label (stream, name);
+ vms_check_external (NULL_TREE, name, 0);
+}
#endif /* VMS_TARGET */
\f
/* Additional support code for VMS host. */
/* This macro definition sets up a default value for `main' to return. */
#define DEFAULT_MAIN_RETURN c_expand_return (integer_one_node)
\f
-/* This is how to output a command to make the user-level label named NAME
- defined for reference from other files. */
-
-#undef ASM_GLOBALIZE_LABEL
-#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
- do { fputs (".globl ", FILE); \
- assemble_name (FILE, NAME); \
- fputs ("\n", FILE); \
- vms_check_external (NULL_TREE, NAME, 0); \
- } while (0)
+/* Globalizing directive for a label. */
+#define GLOBAL_ASM_OP ".globl "
/* Under VMS we write the actual size of the storage to be allocated even
though the symbol is external. Although it is possible to give external
#define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME))
#endif
-/* A C statement (sans semicolon) to output to the stdio stream FILE
- some commands that will make the label NAME global; that is,
- available for reference from other files. */
-
-#if !defined(ASM_GLOBALIZE_LABEL) && defined(GLOBAL_ASM_OP)
-#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
- do { \
- fputs (GLOBAL_ASM_OP, (FILE)); \
- assemble_name ((FILE), (NAME)); \
- fputc ('\n', (FILE)); \
- } while (0)
-#endif
-
/* Allow target to print debug info labels specially. This is useful for
VLIW targets, since debug info labels should go into the middle of
instruction bundles instead of breaking them. */
You may wish to use @code{ASM_OUTPUT_SIZE_DIRECTIVE} and/or
@code{ASM_OUTPUT_MEASURED_SIZE} in the definition of this macro.
-@findex ASM_GLOBALIZE_LABEL
-@item ASM_GLOBALIZE_LABEL (@var{stream}, @var{name})
-A C statement (sans semicolon) to output to the stdio stream
+@deftypefn {Target Hook} void TARGET_ASM_GLOBALIZE_LABEL (FILE *@var{stream}, const char *@var{name})
+This target hook is a function to output to the stdio stream
@var{stream} some commands that will make the label @var{name} global;
-that is, available for reference from other files. Use the expression
-@code{assemble_name (@var{stream}, @var{name})} to output the name
-itself; before and after that, output the additional assembler syntax
-for making that name global, and a newline.
+that is, available for reference from other files.
-If you define @code{GLOBAL_ASM_OP}, a default definition is provided
-which is correct for most systems.
+The default implementation relies on a proper definition of
+@code{GLOBAL_ASM_OP}.
@findex ASM_WEAKEN_LABEL
@item ASM_WEAKEN_LABEL (@var{stream}, @var{name})
data_section ();
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
- ASM_GLOBALIZE_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
+ (*targetm.asm_out.globalize_label) (asm_out_file, IDENTIFIER_POINTER (label));
ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
#endif
}
/* We make these global, not weak; if the target doesn't support
.linkonce, it doesn't support combining the sections, so debugging
will break. */
- ASM_GLOBALIZE_LABEL (asm_out_file, sym);
+ (*targetm.asm_out.globalize_label) (asm_out_file, sym);
ASM_OUTPUT_LABEL (asm_out_file, sym);
}
ASM_WEAKEN_LABEL (file, name);
#endif
case LABEL_GLOBAL_ENTRY:
- ASM_GLOBALIZE_LABEL (file, name);
+ (*targetm.asm_out.globalize_label) (file, name);
case LABEL_STATIC_ENTRY:
#ifdef ASM_OUTPUT_TYPE_DIRECTIVE
ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function");
int b ATTRIBUTE_UNUSED;
{
}
+
+/* Generic hook that takes (FILE *, const char *) and does nothing. */
+void
+hook_FILEptr_constcharptr_void (a, b)
+ FILE *a ATTRIBUTE_UNUSED;
+ const char *b ATTRIBUTE_UNUSED;
+{
+}
bool hook_tree_bool_false PARAMS ((tree));
void hook_tree_int_void PARAMS ((tree, int));
void hook_void_void PARAMS ((void));
+void hook_FILEptr_constcharptr_void PARAMS ((FILE *, const char *));
#endif
extern void assemble_external_libcall PARAMS ((rtx));
#endif
-/* Declare the label NAME global. */
-extern void assemble_global PARAMS ((const char *));
-
/* Assemble a label named NAME. */
extern void assemble_label PARAMS ((const char *));
extern void assemble_eh_label PARAMS ((const char *));
unsigned HOST_WIDE_INT));
extern const char *default_strip_name_encoding PARAMS ((const char *));
extern bool default_binds_local_p PARAMS ((tree));
+extern void default_globalize_label PARAMS ((FILE *, const char *));
/* Emit data for vtable gc for GNU binutils. */
extern void assemble_vtable_entry PARAMS ((struct rtx_def *, HOST_WIDE_INT));
MD_INIT_BUILTINS MD_EXPAND_BUILTIN ASM_OUTPUT_CONSTRUCTOR \
ASM_OUTPUT_DESTRUCTOR SIGNED_CHAR_SPEC MAX_CHAR_TYPE_SIZE \
WCHAR_UNSIGNED UNIQUE_SECTION SELECT_SECTION SELECT_RTX_SECTION \
- ENCODE_SECTION_INFO STRIP_NAME_ENCODING
+ ENCODE_SECTION_INFO STRIP_NAME_ENCODING ASM_GLOBALIZE_LABEL
/* 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_INTEGER default_assemble_integer
+#ifndef TARGET_ASM_GLOBALIZE_LABEL
+#define TARGET_ASM_GLOBALIZE_LABEL default_globalize_label
+#endif
+
#define TARGET_ASM_FUNCTION_PROLOGUE default_function_pro_epilogue
#define TARGET_ASM_FUNCTION_EPILOGUE default_function_pro_epilogue
#define TARGET_ASM_FUNCTION_END_PROLOGUE no_asm_to_stream
TARGET_ASM_ALIGNED_INT_OP, \
TARGET_ASM_UNALIGNED_INT_OP, \
TARGET_ASM_INTEGER, \
+ TARGET_ASM_GLOBALIZE_LABEL, \
TARGET_ASM_FUNCTION_PROLOGUE, \
TARGET_ASM_FUNCTION_END_PROLOGUE, \
TARGET_ASM_FUNCTION_BEGIN_EPILOGUE, \
and UNALIGNED_OP are NULL. */
bool (* integer) PARAMS ((rtx x, unsigned int size, int aligned_p));
+ /* Output code that will globalize a label. */
+ void (* globalize_label) PARAMS ((FILE *, const char *));
+
/* Output the assembler code for entry to a function. */
void (* function_prologue) PARAMS ((FILE *, HOST_WIDE_INT));
const char *name;
int size ATTRIBUTE_UNUSED, rounded;
{
- ASM_GLOBALIZE_LABEL (file, name);
+ (*targetm.asm_out.globalize_label) (file, name);
bss_section ();
#ifdef ASM_DECLARE_OBJECT_NAME
last_assemble_variable_decl = decl;
const char *name;
int size, align;
{
- ASM_GLOBALIZE_LABEL (file, name);
+ (*targetm.asm_out.globalize_label) (file, name);
bss_section ();
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
#ifdef ASM_DECLARE_OBJECT_NAME
#endif
}
-/* Declare the label NAME global. */
-
-void
-assemble_global (name)
- const char *name ATTRIBUTE_UNUSED;
-{
- ASM_GLOBALIZE_LABEL (asm_out_file, name);
-}
-
/* Assemble a label named NAME. */
void
}
#endif
- ASM_GLOBALIZE_LABEL (asm_out_file, name);
+ (*targetm.asm_out.globalize_label) (asm_out_file, name);
}
/* Emit an assembler directive to make the symbol for DECL an alias to
return local_p;
}
+/* Default function to output code that will globalize a label. A
+ target must define GLOBAL_ASM_OP or provide it's own function to
+ globalize a label. */
+#ifdef GLOBAL_ASM_OP
+void
+default_globalize_label (stream, name)
+ FILE * stream;
+ const char *name;
+{
+ fputs (GLOBAL_ASM_OP, stream);
+ assemble_name (stream, name);
+ putc ('\n', stream);
+}
+#endif /* GLOBAL_ASM_OP */
+
#include "gt-varasm.h"