summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-21 02:41:51 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-21 02:41:51 +0000
commit67c1e638884ddb1464e4ee36a749cb989571171a (patch)
tree269c31451cd645fdc0e61e57ac97f847064a3806 /gcc/config
parent1ac317974124d603bf8ae222143ef580de864d84 (diff)
downloadgcc-67c1e638884ddb1464e4ee36a749cb989571171a.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56478 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha.c2
-rw-r--r--gcc/config/alpha/elf.h4
-rw-r--r--gcc/config/alpha/osf.h2
-rw-r--r--gcc/config/alpha/unicosmk.h6
-rw-r--r--gcc/config/arm/aof.h10
-rw-r--r--gcc/config/arm/arm.c15
-rw-r--r--gcc/config/arm/unknown-elf.h2
-rw-r--r--gcc/config/c4x/c4x.c12
-rw-r--r--gcc/config/c4x/c4x.h9
-rw-r--r--gcc/config/cris/aout.h2
-rw-r--r--gcc/config/darwin-protos.h1
-rw-r--r--gcc/config/darwin.c9
-rw-r--r--gcc/config/darwin.h10
-rw-r--r--gcc/config/dsp16xx/dsp16xx.c2
-rw-r--r--gcc/config/elfos.h2
-rw-r--r--gcc/config/frv/frv.h13
-rw-r--r--gcc/config/i370/i370.c16
-rw-r--r--gcc/config/i370/i370.h12
-rw-r--r--gcc/config/i386/i386.c2
-rw-r--r--gcc/config/i386/sco5.h4
-rw-r--r--gcc/config/ia64/ia64.c2
-rw-r--r--gcc/config/ia64/sysv4.h4
-rw-r--r--gcc/config/m32r/m32r.h2
-rw-r--r--gcc/config/mips/elf.h2
-rw-r--r--gcc/config/mips/iris5.h2
-rw-r--r--gcc/config/mips/linux.h2
-rw-r--r--gcc/config/mips/mips.h2
-rw-r--r--gcc/config/mmix/mmix-protos.h1
-rw-r--r--gcc/config/mmix/mmix.c12
-rw-r--r--gcc/config/mmix/mmix.h3
-rw-r--r--gcc/config/ns32k/ns32k.c13
-rw-r--r--gcc/config/ns32k/ns32k.h7
-rw-r--r--gcc/config/pa/pa-linux.h2
-rw-r--r--gcc/config/pa/pa.c15
-rw-r--r--gcc/config/pa/pa.h12
-rw-r--r--gcc/config/rs6000/darwin.h11
-rw-r--r--gcc/config/rs6000/sysv4.h2
-rw-r--r--gcc/config/rs6000/xcoff.h5
-rw-r--r--gcc/config/v850/v850.c2
-rw-r--r--gcc/config/vax/vax.c14
-rw-r--r--gcc/config/vax/vms.h12
41 files changed, 140 insertions, 122 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 7fa6ba03337..7734bc89399 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -245,6 +245,8 @@ static void unicosmk_unique_section PARAMS ((tree, int));
# 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
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
index 15018aad4dd..806d95f4420 100644
--- a/gcc/config/alpha/elf.h
+++ b/gcc/config/alpha/elf.h
@@ -112,7 +112,7 @@ do { \
#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,
@@ -156,7 +156,7 @@ do { \
#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)
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index 6d5ea3bb882..268c124c8ce 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -198,7 +198,7 @@ __enable_execute_stack (addr) \
#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) \
diff --git a/gcc/config/alpha/unicosmk.h b/gcc/config/alpha/unicosmk.h
index 457cfbad737..8f7b53db071 100644
--- a/gcc/config/alpha/unicosmk.h
+++ b/gcc/config/alpha/unicosmk.h
@@ -349,12 +349,6 @@ ssib_section () \
#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. */
diff --git a/gcc/config/arm/aof.h b/gcc/config/arm/aof.h
index 3760527db42..965337cf700 100644
--- a/gcc/config/arm/aof.h
+++ b/gcc/config/arm/aof.h
@@ -220,14 +220,8 @@ do \
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 { \
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index d44ec803eb2..56c7e276efc 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -123,6 +123,9 @@ static void arm_elf_asm_named_section PARAMS ((const char *, unsigned int));
#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
@@ -145,6 +148,8 @@ static void arm_encode_section_info PARAMS ((tree, int));
#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
@@ -10950,6 +10955,16 @@ aof_dump_imports (f)
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
diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h
index df3977c1c56..bf2eee2bb69 100644
--- a/gcc/config/arm/unknown-elf.h
+++ b/gcc/config/arm/unknown-elf.h
@@ -61,7 +61,7 @@ Boston, MA 02111-1307, USA. */
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)); \
\
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 5b4c5709b31..2ed42bee362 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -193,6 +193,7 @@ static void c4x_insert_attributes PARAMS ((tree, tree *));
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 *));
/* Initialize the GCC target structure. */
#undef TARGET_ASM_BYTE_OP
@@ -220,6 +221,9 @@ static void c4x_encode_section_info PARAMS ((tree, int));
#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;
/* Override command line options.
@@ -5045,3 +5049,11 @@ c4x_asm_named_section (name, flags)
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);
+}
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index ace2397a872..80722cc32c6 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -1704,13 +1704,8 @@ fini_section () \
#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)
diff --git a/gcc/config/cris/aout.h b/gcc/config/cris/aout.h
index 9d92dbbebdb..fe99c769a0d 100644
--- a/gcc/config/cris/aout.h
+++ b/gcc/config/cris/aout.h
@@ -277,7 +277,7 @@ Boston, MA 02111-1307, USA. */
#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 \
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index 96b614fd17a..efce90af00c 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -114,3 +114,4 @@ extern void machopic_symbol_stub_section PARAMS ((void));
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 *));
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 2fdc20a799a..fc162d07fff 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1285,5 +1285,14 @@ machopic_asm_out_destructor (symbol, priority)
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"
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 85456c65c81..f6ed2946a39 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -504,15 +504,13 @@ objc_section_init () \
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) \
diff --git a/gcc/config/dsp16xx/dsp16xx.c b/gcc/config/dsp16xx/dsp16xx.c
index b30e4052331..b031aa2bdcb 100644
--- a/gcc/config/dsp16xx/dsp16xx.c
+++ b/gcc/config/dsp16xx/dsp16xx.c
@@ -2198,7 +2198,7 @@ asm_output_common(file, name, size, rounded)
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)
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h
index 11b1e65fe79..8135ab70a6f 100644
--- a/gcc/config/elfos.h
+++ b/gcc/config/elfos.h
@@ -172,7 +172,7 @@ Boston, MA 02111-1307, USA. */
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,
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index 37c28e3ed19..0bd7b4decb3 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -2997,17 +2997,8 @@ do { \
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
diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c
index e19f72e79b7..e84ccc85a14 100644
--- a/gcc/config/i370/i370.c
+++ b/gcc/config/i370/i370.c
@@ -101,6 +101,7 @@ static label_node_t * mvs_get_label PARAMS ((int));
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));
@@ -301,6 +302,8 @@ static const unsigned char ebcasc[256] =
#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
@@ -1416,6 +1419,19 @@ i370_output_function_prologue (f, l)
/* 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 */
diff --git a/gcc/config/i370/i370.h b/gcc/config/i370/i370.h
index f71352c7e07..7bcbdf893a1 100644
--- a/gcc/config/i370/i370.h
+++ b/gcc/config/i370/i370.h
@@ -1073,18 +1073,6 @@ enum reg_class
} \
}
-#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 '#'. */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 663e7677a4e..2f66a01230b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3931,7 +3931,7 @@ ix86_asm_file_end (file)
(*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);
diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h
index 1392c700c65..9d7c314d5a7 100644
--- a/gcc/config/i386/sco5.h
+++ b/gcc/config/i386/sco5.h
@@ -350,11 +350,9 @@ do { \
#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) \
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 4e3e81dd92b..08a2dfacbaf 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -4060,7 +4060,7 @@ ia64_asm_output_external (file, decl, name)
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;
}
diff --git a/gcc/config/ia64/sysv4.h b/gcc/config/ia64/sysv4.h
index 164beba04f7..3254fa5e2fd 100644
--- a/gcc/config/ia64/sysv4.h
+++ b/gcc/config/ia64/sysv4.h
@@ -33,8 +33,8 @@
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;
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index 89d147d8566..2b3720dd3be 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -1852,7 +1852,7 @@ extern char m32r_punct_chars[256];
#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)
diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h
index 692a903f91a..6e9004b6e67 100644
--- a/gcc/config/mips/elf.h
+++ b/gcc/config/mips/elf.h
@@ -106,7 +106,7 @@ do { \
#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 \
diff --git a/gcc/config/mips/iris5.h b/gcc/config/mips/iris5.h
index cb7753b27b8..e26d53bf2d8 100644
--- a/gcc/config/mips/iris5.h
+++ b/gcc/config/mips/iris5.h
@@ -190,7 +190,7 @@ do { \
#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) \
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index 5564ad1e273..d25cd51ddcc 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -45,7 +45,7 @@ Boston, MA 02111-1307, USA. */
`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 \
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index a9016b8c0f8..ee5ccf2f48c 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -4335,7 +4335,7 @@ while (0)
|| 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)); \
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index 0f43e869636..e8ef95e9895 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -40,7 +40,6 @@ extern void mmix_output_quoted_string PARAMS ((FILE *, const char *, int));
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
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index cbda5257efb..deb6b1ef976 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -1520,18 +1520,6 @@ mmix_asm_declare_register_global (stream, decl, regno, name)
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
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 218bd06aafa..5da23882b9b 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -980,8 +980,7 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
#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)
diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c
index 5c5252cbf02..ee419a07885 100644
--- a/gcc/config/ns32k/ns32k.c
+++ b/gcc/config/ns32k/ns32k.c
@@ -70,6 +70,9 @@ const struct attribute_spec ns32k_attribute_table[];
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
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
@@ -1573,3 +1576,13 @@ ns32k_encode_section_info (decl, first)
|| ! 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
diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h
index 2b7727e3cee..7bc02d4ed9d 100644
--- a/gcc/config/ns32k/ns32k.h
+++ b/gcc/config/ns32k/ns32k.h
@@ -1319,12 +1319,11 @@ __transfer_from_trampoline () \
/* 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
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index 09b180e6a10..0fcb1e5095c 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -169,7 +169,7 @@ Boston, MA 02111-1307, USA. */
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 "
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 54ef0b92e2c..9f692537a46 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -116,6 +116,7 @@ static void pa_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT))
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. */
@@ -7701,4 +7702,18 @@ pa_select_section (exp, reloc, align)
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"
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 711d7491540..04e417f3640 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -1679,17 +1679,7 @@ do { \
#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))
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 417cfb9697d..f3e1d715aa5 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -103,13 +103,10 @@ Boston, MA 02111-1307, USA. */
#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. */
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 8b6cf1c3b29..34cb80eeb26 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -716,7 +716,7 @@ do { \
/* 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)
diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h
index 1e53a0c4e4a..acc10def748 100644
--- a/gcc/config/rs6000/xcoff.h
+++ b/gcc/config/rs6000/xcoff.h
@@ -196,9 +196,8 @@ toc_section () \
/* 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.
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 7c3dd3eb56b..80096781ae6 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -2632,7 +2632,7 @@ v850_output_aligned_bss (file, decl, name, size, align)
int size;
int align;
{
- ASM_GLOBALIZE_LABEL (file, name);
+ (*targetm.asm_out.globalize_label) (file, name);
switch (v850_get_data_area (decl))
{
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 0cca78c769c..9c929cc4d9f 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -45,6 +45,7 @@ static void vms_asm_out_constructor PARAMS ((rtx, int));
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
/* Initialize the GCC target structure. */
@@ -59,6 +60,8 @@ static void vms_encode_section_info PARAMS ((tree, int));
#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;
@@ -925,6 +928,17 @@ vms_encode_section_info (decl, first)
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 */
/* Additional support code for VMS host. */
diff --git a/gcc/config/vax/vms.h b/gcc/config/vax/vms.h
index 943882975d5..870ebaf04eb 100644
--- a/gcc/config/vax/vms.h
+++ b/gcc/config/vax/vms.h
@@ -90,16 +90,8 @@ Boston, MA 02111-1307, USA. */
/* This macro definition sets up a default value for `main' to return. */
#define DEFAULT_MAIN_RETURN c_expand_return (integer_one_node)
-/* 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