aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-10-23 10:21:36 +0000
committerRichard Stallman <rms@gnu.org>1992-10-23 10:21:36 +0000
commit561e66508917fad2ede3d5f841d39060df194dca (patch)
tree10417afe56496d01d8e300a4fb1da762632e6f2b /gcc
parente42b4c96267488cdce926300487d9f2582243690 (diff)
downloadgcc-561e66508917fad2ede3d5f841d39060df194dca.zip
gcc-561e66508917fad2ede3d5f841d39060df194dca.tar.gz
gcc-561e66508917fad2ede3d5f841d39060df194dca.tar.bz2
New macro to decode a symbol name munged by ENCODE_SECTION_INFO.
(STRIP_NAME_ENCODING): New macro to decode a symbol name munged by ENCODE_SECTION_INFO. (assemble_start_function, assemble_variable): Use STRIP_NAME_ENCODING. From-SVN: r2572
Diffstat (limited to 'gcc')
-rw-r--r--gcc/varasm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 4559d5e..e5d757c 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -49,6 +49,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define ASM_STABS_OP ".stabs"
#endif
+/* This macro gets just the user-specified name
+ out of the string in a SYMBOL_REF. On most machines,
+ we discard the * if any and that's all. */
+#ifndef STRIP_NAME_ENCODING
+#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
+ (VAR) = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*'))
+#endif
+
/* File in which assembler code is being written. */
extern FILE *asm_out_file;
@@ -549,7 +557,7 @@ assemble_start_function (decl, fnname)
if (TREE_PUBLIC (decl))
{
if (!first_global_object_name)
- first_global_object_name = fnname + (fnname[0] == '*');
+ STRIP_NAME_ENCODING (first_global_object_name, fnname);
ASM_GLOBALIZE_LABEL (asm_out_file, fnname);
}
@@ -839,7 +847,7 @@ assemble_variable (decl, top_level, at_end)
if (TREE_PUBLIC (decl) && DECL_NAME (decl))
{
if (!first_global_object_name)
- first_global_object_name = name + (name[0] == '*');
+ STRIP_NAME_ENCODING(first_global_object_name, name);
ASM_GLOBALIZE_LABEL (asm_out_file, name);
}
#if 0