From 561e66508917fad2ede3d5f841d39060df194dca Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Fri, 23 Oct 1992 10:21:36 +0000 Subject: [PATCH] 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 --- gcc/varasm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/varasm.c b/gcc/varasm.c index 4559d5e0323..e5d757cde4d 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 -- 2.30.2