summaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-28 22:31:06 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-28 22:31:06 +0000
commit95c4b02aaeba67721e262ff3cc618e62453e6edb (patch)
treef7991921f56af47e0a4753b402cdb868e740a0f6 /gcc/toplev.c
parent08337bc31ad32b3be939c6f353d5a32a304dd249 (diff)
downloadgcc-95c4b02aaeba67721e262ff3cc618e62453e6edb.tar.gz
* Makefile.in (cc1): Put C_OBJS, and thence @extra_c_objs@ last.
(LIBCPP_OBJS): New. Add cppulp.o. (cppmain, fix-header): Depend on and use libcpp.a. * configure.in (extra_c_objs, extra_cxx_objs): Use libcpp.a instead of the individual object files. * objc/Make-lang.in (cc1obj): Put OBJC_OBJS, and thence @extra_c_objs@, last. * cccp.c (user_label_prefix): New. (main): Set it off -f*leading-underscore. (special_symbol): Use it. * cpplib.c (special_symbol): Likewise. (cpp_handle_option): Handle -f*leading-underscore. * cppulp.c: New file. * output.h (user_label_prefix): Declare it. * dwarf2out.c (ASM_NAME_TO_STRING): Prepend user_label_prefix. * toplev.c (f_options, main): Handle -f*leading-underscore. * defaults.h (ASM_OUTPUT_LABELREF): Use asm_fprintf instead of referencing USER_LABEL_PREFIX directly. * config/nextstep.h (ASM_OUTPUT_LABELREF): Likewise. * m32r/m32r.h (ASM_OUTPUT_LABELREF): Likewise. * final.c (asm_fprintf): Use user_label_prefix instead. * arm/thumb.c (thumb_print_operand): Likewise. * gcc.c (default_compilers): Pass -f*leading-underscore on to cpp wherever appropriate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23415 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 197d2801d78..5acb8f014b2 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -770,6 +770,17 @@ typedef struct
}
lang_independent_options;
+/* Add or remove a leading underscore from user symbols. */
+int flag_leading_underscore = -1;
+
+/* The user symbol prefix after having resolved same. */
+char *user_label_prefix;
+
+/* A default for same. */
+#ifndef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX ""
+#endif
+
/* Table of language-independent -f options.
STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in VARIABLE
@@ -915,6 +926,8 @@ lang_independent_options f_options[] =
"Suppress output of instruction numbers and line number notes in debugging dumps"},
{"instrument-functions", &flag_instrument_function_entry_exit, 1,
"Instrument function entry/exit with profiling calls"},
+ {"leading-underscore", &flag_leading_underscore, 1,
+ "External symbols have a leading underscore" }
};
#define NUM_ELEM(a) (sizeof (a) / sizeof ((a)[0]))
@@ -4899,6 +4912,21 @@ main (argc, argv)
warning ("this target machine does not have delayed branches");
#endif
+ user_label_prefix = USER_LABEL_PREFIX;
+ if (flag_leading_underscore != -1)
+ {
+ /* If the default prefix is more complicated than "" or "_",
+ issue a warning and ignore this option. */
+ if (user_label_prefix[0] == 0 ||
+ (user_label_prefix[0] == '_' && user_label_prefix[1] == 0))
+ {
+ user_label_prefix = flag_leading_underscore ? "_" : "";
+ }
+ else
+ warning ("-f%sleading-underscore not supported on this target machine",
+ flag_leading_underscore ? "" : "no-");
+ }
+
/* If we are in verbose mode, write out the version and maybe all the
option flags in use. */
if (version_flag)