aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2002-08-21 02:41:51 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2002-08-21 02:41:51 +0000
commit5eb99654a2c06c5547396318e121deb995076802 (patch)
tree269c31451cd645fdc0e61e57ac97f847064a3806 /gcc
parentf8f28a755cc2a489d56a7affb95b2671b08fa8b8 (diff)
downloadgcc-5eb99654a2c06c5547396318e121deb995076802.zip
gcc-5eb99654a2c06c5547396318e121deb995076802.tar.gz
gcc-5eb99654a2c06c5547396318e121deb995076802.tar.bz2
alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk.
* alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk. * alpha/elf.h (ASM_OUTPUT_EXTERNAL_LIBCALL, ASM_OUTPUT_ALIGNED_BSS): Use target hook. * alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS): Likewise. * alpha/unicosmk.h (ASM_GLOBALIZE_LABEL): Delete. * arm/aof.h (ASM_GLOBALIZE_LABEL): Likewise. (GLOBAL_ASM_OP): Define. * arm.c (aof_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for AOF. * arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * c4x.c (c4x_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for c4x. * c4x.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * cris/aout.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. * darwin-protos.h (darwin_globalize_label): Declare. * darwin.c (darwin_globalize_label): New function. * darwin.h (ASM_DECLARE_CLASS_REFERENCE): Use target hook. (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP, TARGET_ASM_GLOBALIZE_LABEL): Define. * dsp16xx.c (asm_output_common): Use target hook. * elfos.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise. * frv.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * i370.c (i370_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for i370. * i370.h (ASM_GLOBALIZE_LABEL): Delete. * i386.c (ix86_asm_file_end): Use target hook. * i386/sco5.h (ASM_GLOBALIZE_LABEL): Don't undef. (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. * ia64.c (ia64_asm_output_external): Likewise. * ia64/sysv4.h: Update comment. * m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. * mips/iris5.h (ASM_OUTPUT_WEAK_ALIAS): Use target hook. * mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. * mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use target hook. * mmix-protos.h (mmix_asm_globalize_label): Delete. * mmix.c (mmix_asm_globalize_label): Likewise. * mmix.h (ASM_GLOBALIZE_LABEL): Likewise. (GLOBAL_ASM_OP): Define. * ns32k.c (ns32k_globalize_label): New function. * ns32k.h (TARGET_ASM_GLOBALIZE_LABEL): Define for ns32k. (ASM_GLOBALIZE_LABEL): Delete. * pa/pa-linux.h (ASM_GLOBALIZE_LABEL): Don't undef. (TARGET_ASM_GLOBALIZE_LABEL): Undefine. * pa.c (pa_globalize_label): New function. * pa.h (ASM_GLOBALIZE_LABEL): Delete. (TARGET_ASM_GLOBALIZE_LABEL): Define for pa. * rs6000/darwin.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. (TARGET_ASM_GLOBALIZE_LABEL): Undef. * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * rs6000/xcoff.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * v850.c (v850_output_aligned_bss): Use target hook. * vax.c (vms_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for vms. * vax/vms.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * defaults.h (ASM_GLOBALIZE_LABEL): Delete. * doc/tm.texi: Update docs. * dwarf2out.c (default_eh_frame_section, output_die_symbol): Use target hook. * final.c (output_alternate_entry_point): Likewise. * hooks.c (hook_FILEptr_constcharptr_void): New function. * hooks.h (hook_FILEptr_constcharptr_void): Declare. * output.h (assemble_global): Delete. (default_globalize_label): Declare. * system.h (ASM_GLOBALIZE_LABEL): Poison. * target-def.h (TARGET_ASM_GLOBALIZE_LABEL): Define. (TARGET_ASM_OUT): Add TARGET_ASM_GLOBALIZE_LABEL. * target.h (gcc_target): Add globalize_label member. * varasm.c (asm_output_bss, asm_output_aligned_bss, globalize_decl): Use target hook. (assemble_global): Delete. (default_globalize_label): New function. From-SVN: r56478
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog80
-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
-rw-r--r--gcc/defaults.h13
-rw-r--r--gcc/doc/tm.texi14
-rw-r--r--gcc/dwarf2out.c4
-rw-r--r--gcc/final.c2
-rw-r--r--gcc/hooks.c8
-rw-r--r--gcc/hooks.h1
-rw-r--r--gcc/output.h4
-rw-r--r--gcc/system.h2
-rw-r--r--gcc/target-def.h5
-rw-r--r--gcc/target.h3
-rw-r--r--gcc/varasm.c30
53 files changed, 265 insertions, 163 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 578f4a0..7094935 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,85 @@
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>
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 7fa6ba0..7734bc8 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 15018aa..806d95f 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 6d5ea3b..268c124 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 457cfba..8f7b53d 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 3760527..965337c 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 d44ec80..56c7e27 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 df3977c..bf2eee2 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 5b4c570..2ed42be 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 ace2397..80722cc 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 9d92dbb..fe99c76 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 96b614f..efce90af 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 2fdc20a..fc162d0 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 85456c6..f6ed294 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 b30e405..b031aa2 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 11b1e65..8135ab7 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 37c28e3..0bd7b4d 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 e19f72e..e84ccc8 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 f71352c7e..7bcbdf8 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 663e767..2f66a01 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 1392c70..9d7c314 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 4e3e81d..08a2dfa 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 164beba..3254fa5 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 89d147d..2b3720d 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 692a903..6e9004b 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 cb7753b..e26d53b 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 5564ad1..d25cd51 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 a9016b8..ee5ccf2 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 0f43e86..e8ef95e 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 cbda525..deb6b1e 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 218bd06..5da2388 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 5c5252c..ee419a0 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 2b7727e..7bc02d4 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 09b180e..0fcb1e5 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 54ef0b9..9f69253 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 711d749..04e417f 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 417cfb9..f3e1d71 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 8b6cf1c..34cb80e 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 1e53a0c..acc10de 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 7c3dd3e..8009678 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 0cca78c..9c929cc 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 9438829..870ebaf 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
diff --git a/gcc/defaults.h b/gcc/defaults.h
index ae115b8..157aa01 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -154,19 +154,6 @@ do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \
#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. */
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 064120d..4caef1d 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -6582,17 +6582,13 @@ nothing.
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})
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 4368fd3..cf692d6 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -122,7 +122,7 @@ default_eh_frame_section ()
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
}
@@ -6122,7 +6122,7 @@ output_die_symbol (die)
/* 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);
}
diff --git a/gcc/final.c b/gcc/final.c
index 3ce6a13..9d2c426 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1965,7 +1965,7 @@ output_alternate_entry_point (file, insn)
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");
diff --git a/gcc/hooks.c b/gcc/hooks.c
index 508e29c..0eb0e14 100644
--- a/gcc/hooks.c
+++ b/gcc/hooks.c
@@ -54,3 +54,11 @@ hook_tree_int_void (a, b)
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;
+{
+}
diff --git a/gcc/hooks.h b/gcc/hooks.h
index 2bed2dd..4b80c32 100644
--- a/gcc/hooks.h
+++ b/gcc/hooks.h
@@ -26,5 +26,6 @@ bool hook_void_bool_false PARAMS ((void));
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
diff --git a/gcc/output.h b/gcc/output.h
index 533af93..fadf5f8 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -306,9 +306,6 @@ extern void assemble_string PARAMS ((const char *, int));
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 *));
@@ -540,6 +537,7 @@ extern void default_elf_select_rtx_section PARAMS ((enum machine_mode, rtx,
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));
diff --git a/gcc/system.h b/gcc/system.h
index 63408da..0a77c8f 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -604,7 +604,7 @@ typedef char _Bool;
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
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 63fbead..b2bf074 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -54,6 +54,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#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
@@ -140,6 +144,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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, \
diff --git a/gcc/target.h b/gcc/target.h
index 7496fbb..b63fc0f 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -69,6 +69,9 @@ struct gcc_target
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));
diff --git a/gcc/varasm.c b/gcc/varasm.c
index c826849..b3ea8aa 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -506,7 +506,7 @@ asm_output_bss (file, decl, name, size, rounded)
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;
@@ -534,7 +534,7 @@ asm_output_aligned_bss (file, decl, name, size, align)
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
@@ -1754,15 +1754,6 @@ assemble_external_libcall (fun)
#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
@@ -4548,7 +4539,7 @@ globalize_decl (decl)
}
#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
@@ -5249,4 +5240,19 @@ default_binds_local_p (exp)
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"