aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Stump <mrs@gcc.gnu.org>1993-03-25 08:51:26 +0000
committerMike Stump <mrs@gcc.gnu.org>1993-03-25 08:51:26 +0000
commitd0d4af87cc5db924b337c8076cae91c65d19291c (patch)
treecfdc93c4bf9c6428d1d2d5f186799cfecb06737b
parentd1e37dc7e8bee5ba20eb7c04148a9e6cf379d946 (diff)
downloadgcc-d0d4af87cc5db924b337c8076cae91c65d19291c.zip
gcc-d0d4af87cc5db924b337c8076cae91c65d19291c.tar.gz
gcc-d0d4af87cc5db924b337c8076cae91c65d19291c.tar.bz2
Added front-end taggint to object files.
From-SVN: r3874
-rw-r--r--gcc/c-lang.c6
-rw-r--r--gcc/defaults.h10
-rw-r--r--gcc/objc/objc-act.c6
-rw-r--r--gcc/toplev.c18
-rw-r--r--gcc/tree.h3
5 files changed, 43 insertions, 0 deletions
diff --git a/gcc/c-lang.c b/gcc/c-lang.c
index c62f8d2..fe4acab 100644
--- a/gcc/c-lang.c
+++ b/gcc/c-lang.c
@@ -47,6 +47,12 @@ lang_finish ()
{
}
+char *
+lang_identify ()
+{
+ return "c";
+}
+
/* Used by c-lex.c, but only for objc. */
tree
lookup_interface (arg)
diff --git a/gcc/defaults.h b/gcc/defaults.h
index e943fa6..7234206 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -108,3 +108,13 @@ do { fprintf (FILE, "\t%s\t", ASM_SHORT); \
} \
while (0)
#endif
+
+#ifndef ASM_IDENTIFY_GCC
+ /* Default the definition, only if ASM_IDENTIFY_GCC is not set,
+ because if it is set, we might not want ASM_IDENTIFY_LANGUAGE
+ outputting labels, if we do want it to, then it must be defined
+ in the tm.h file. */
+#ifndef ASM_IDENTIFY_LANGUAGE
+#define ASM_IDENTIFY_LANGUAGE(FILE) output_lang_identify (FILE);
+#endif
+#endif
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index bfffa78..a7ae676 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -371,6 +371,12 @@ lang_finish ()
{
}
+char *
+lang_identify ()
+{
+ return "objc";
+}
+
int
lang_decode_option (p)
char *p;
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 3ac6132..34351b1 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -52,6 +52,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "rtl.h"
#include "flags.h"
#include "insn-attr.h"
+#include "defaults.h"
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h"
@@ -1495,6 +1496,17 @@ output_file_directive (asm_file, input_name)
#endif
}
+/* Routine to build language identifier for object file. */
+static void
+output_lang_identify (asm_out_file)
+ FILE *asm_out_file;
+{
+ int len = strlen (lang_identify ()) + sizeof ("__gnu_compiled_") + 1;
+ char *s = (char *) alloca (len);
+ sprintf (s, "__gnu_compiled_%s", lang_identify ());
+ ASM_OUTPUT_LABEL (asm_out_file, s);
+}
+
/* Compile an entire file of output from cpp, named NAME.
Write a file of assembly output and various debugging dumps. */
@@ -1789,6 +1801,12 @@ compile_file (name)
#else
ASM_IDENTIFY_GCC (asm_out_file);
#endif
+
+ /* Output something to identify which front-end produced this file. */
+#ifdef ASM_IDENTIFY_LANGUAGE
+ ASM_IDENTIFY_LANGUAGE (asm_out_file);
+#endif
+
/* Don't let the first function fall at the same address
as gcc_compiled., if profiling. */
if (profile_flag || profile_block_flag)
diff --git a/gcc/tree.h b/gcc/tree.h
index 555f877..5e2522f 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1427,6 +1427,9 @@ extern void init_decl_processing PROTO((void));
extern void lang_init PROTO((void));
extern void lang_finish PROTO((void));
+/* Funtion to identify which front-end produced the output file. */
+extern char *lang_identify PROTO((void));
+
/* Function called with no arguments to parse and compile the input. */
extern int yyparse PROTO((void));
/* Function called with option as argument