aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha.c24
-rw-r--r--gcc/config/alpha/alpha.h9
-rw-r--r--gcc/config/arm/arm.c3
-rw-r--r--gcc/config/arm/arm.h6
-rw-r--r--gcc/config/arm/pe.c3
-rw-r--r--gcc/config/avr/avr.c8
-rw-r--r--gcc/config/avr/avr.h6
-rw-r--r--gcc/config/cris/cris.c4
-rw-r--r--gcc/config/darwin-protos.h1
-rw-r--r--gcc/config/darwin.c28
-rw-r--r--gcc/config/darwin.h53
-rw-r--r--gcc/config/h8300/h8300.c12
-rw-r--r--gcc/config/h8300/h8300.h7
-rw-r--r--gcc/config/i386/cygwin.h35
-rw-r--r--gcc/config/i386/i386-interix.h37
-rw-r--r--gcc/config/i386/i386-protos.h5
-rw-r--r--gcc/config/i386/interix.c3
-rw-r--r--gcc/config/i386/win32.h26
-rw-r--r--gcc/config/i386/winnt.c35
-rw-r--r--gcc/config/ia64/ia64.c14
-rw-r--r--gcc/config/ia64/ia64.h12
-rw-r--r--gcc/config/m32r/m32r.c15
-rw-r--r--gcc/config/m32r/m32r.h19
-rw-r--r--gcc/config/mcore/mcore-elf.h2
-rw-r--r--gcc/config/mcore/mcore-pe.h2
-rw-r--r--gcc/config/mcore/mcore.c14
-rw-r--r--gcc/config/mcore/mcore.h14
-rw-r--r--gcc/config/mips/mips.c2
-rw-r--r--gcc/config/mmix/mmix-protos.h1
-rw-r--r--gcc/config/mmix/mmix.c7
-rw-r--r--gcc/config/mmix/mmix.h3
-rw-r--r--gcc/config/mn10200/mn10200.h8
-rw-r--r--gcc/config/mn10300/mn10300.h8
-rw-r--r--gcc/config/pa/pa.c14
-rw-r--r--gcc/config/pa/pa.h150
-rw-r--r--gcc/config/pa/som.h5
-rw-r--r--gcc/config/rs6000/rs6000.c39
-rw-r--r--gcc/config/rs6000/sysv4.h15
-rw-r--r--gcc/config/rs6000/xcoff.h32
-rw-r--r--gcc/config/sh/sh.c17
-rw-r--r--gcc/config/sh/sh.h3
-rw-r--r--gcc/config/stormy16/stormy16.h4
-rw-r--r--gcc/config/v850/v850.c10
-rw-r--r--gcc/config/v850/v850.h12
44 files changed, 346 insertions, 381 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 837ec6d..d0b41f7 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -119,6 +119,8 @@ static bool alpha_in_small_data_p
PARAMS ((tree));
static void alpha_encode_section_info
PARAMS ((tree, int));
+static const char *alpha_strip_name_encoding
+ PARAMS ((const char *));
static int some_small_symbolic_operand_1
PARAMS ((rtx *, void *));
static int split_small_symbolic_operand_1
@@ -212,6 +214,8 @@ static void vms_asm_out_destructor PARAMS ((rtx, int));
#define TARGET_IN_SMALL_DATA_P alpha_in_small_data_p
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO alpha_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING alpha_strip_name_encoding
#if TARGET_ABI_UNICOSMK
static void unicosmk_asm_named_section PARAMS ((const char *, unsigned int));
@@ -1708,6 +1712,19 @@ alpha_encode_section_info (decl, first)
}
}
+/* Undo the effects of the above. */
+
+static const char *
+alpha_strip_name_encoding (str)
+ const char *str;
+{
+ if (str[0] == '@')
+ str += 2;
+ if (str[0] == '*')
+ str++;
+ return str;
+}
+
/* legitimate_address_p recognizes an RTL expression that is a valid
memory address for an instruction. The MODE argument is the
machine mode for the MEM expression that wants to use this address.
@@ -8599,7 +8616,7 @@ unicosmk_unique_section (decl, reloc)
abort ();
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
- STRIP_NAME_ENCODING (name, name);
+ name = alpha_strip_name_encoding (name);
len = strlen (name);
if (TREE_CODE (decl) == FUNCTION_DECL)
@@ -8830,8 +8847,7 @@ unicosmk_ssib_name ()
x = XEXP (x, 0);
if (GET_CODE (x) != SYMBOL_REF)
abort ();
- fnname = XSTR (x, 0);
- STRIP_NAME_ENCODING (fnname, fnname);
+ fnname = alpha_strip_name_encoding (XSTR (x, 0));
len = strlen (fnname);
if (len + SSIB_PREFIX_LEN > 255)
@@ -9006,7 +9022,7 @@ unicosmk_output_externs (file)
/* We have to strip the encoding and possibly remove user_label_prefix
from the identifier in order to handle -fleading-underscore and
explicit asm names correctly (cf. gcc.dg/asm-names-1.c). */
- STRIP_NAME_ENCODING (real_name, p->name);
+ real_name = alpha_strip_name_encoding (p->name);
if (len && p->name[0] == '*'
&& !memcmp (real_name, user_label_prefix, len))
real_name += len;
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 260e641..7c1a912 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -1724,15 +1724,6 @@ do { \
#define DATA_SECTION_ASM_OP "\t.data"
-#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
-do { \
- (VAR) = (SYMBOL_NAME); \
- if ((VAR)[0] == '@') \
- (VAR) += 2; \
- if ((VAR)[0] == '*') \
- (VAR)++; \
-} while (0)
-
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index cbcd1a1..111884d 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -180,6 +180,9 @@ static void arm_encode_section_info PARAMS ((tree, int));
#define TARGET_ENCODE_SECTION_INFO arm_encode_section_info
#endif
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING arm_strip_name_encoding
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Obstack for minipool constant handling. */
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index c3946d6..e4ee55a 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1848,12 +1848,6 @@ typedef struct
case '*': return 1; \
SUBTARGET_NAME_ENCODING_LENGTHS
-/* This has to be handled by a function because more than part of the
- ARM backend uses function name prefixes to encode attributes. */
-#undef STRIP_NAME_ENCODING
-#define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME) \
- (VAR) = arm_strip_name_encoding (SYMBOL_NAME)
-
/* This is how to output a reference to a user-level label named NAME.
`assemble_name' uses this. */
#undef ASM_OUTPUT_LABELREF
diff --git a/gcc/config/arm/pe.c b/gcc/config/arm/pe.c
index de74558..c86e231 100644
--- a/gcc/config/arm/pe.c
+++ b/gcc/config/arm/pe.c
@@ -257,8 +257,7 @@ arm_pe_unique_section (decl, reloc)
const char * prefix;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
- /* Strip off any encoding in fnname. */
- STRIP_NAME_ENCODING (name, name);
+ name = arm_strip_name_encoding (name);
/* The object is put in, for example, section .text$foo.
The linker will then ultimately place them in .text
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 262ed63..ea2a193 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -65,7 +65,7 @@ static bool avr_assemble_integer PARAMS ((rtx, unsigned int, int));
static void avr_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void avr_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static void avr_unique_section PARAMS ((tree, int));
-extern void avr_encode_section_info PARAMS ((tree, int));
+static void avr_encode_section_info PARAMS ((tree, int));
/* Allocate registers from r25 to r8 for parameters for function calls */
#define FIRST_CUM_REG 26
@@ -4517,9 +4517,9 @@ avr_unique_section (decl, reloc)
int len;
const char *name, *prefix;
char *string;
+
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
- /* Strip off any encoding in name. */
- STRIP_NAME_ENCODING (name, name);
+ name = (* targetm.strip_name_encoding) (name);
if (TREE_CODE (decl) == FUNCTION_DECL)
{
@@ -4770,7 +4770,7 @@ avr_encode_section_info (decl, first)
DECL_SECTION_NAME (decl) = build_string (strlen (dsec), dsec);
TREE_READONLY (decl) = 1;
}
-}
+}
/* Outputs to the stdio stream FILE some
appropriate text to go at the start of an assembler file. */
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index c227241..ecbc1e5 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -1742,12 +1742,6 @@ progmem_section (void) \
This macro is irrelevant if there is no separate readonly data
section. */
-#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
- (VAR) = (SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*' || (SYMBOL_NAME)[0] == '@');
-/* `STRIP_NAME_ENCODING (VAR, SYM_NAME)'
- Decode SYM_NAME and store the real name part in VAR, sans the
- characters that encode section info. */
-
#define ASM_FILE_START(STREAM) asm_file_start (STREAM)
/* A C expression which outputs to the stdio stream STREAM some
appropriate text to go at the start of an assembler file.
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index e9a3232..f54f39e 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -2591,7 +2591,7 @@ cris_asm_output_mi_thunk (stream, thunkdecl, delta, funcdecl)
{
const char *name = XSTR (XEXP (DECL_RTL (funcdecl), 0), 0);
- STRIP_NAME_ENCODING (name, name);
+ name = (* targetm.strip_name_encoding) (name);
fprintf (stream, "add.d ");
assemble_name (stream, name);
fprintf (stream, "%s,$pc\n", CRIS_PLT_PCOFFSET_SUFFIX);
@@ -2889,7 +2889,7 @@ restart:
const char *origstr = XSTR (x, 0);
const char *str;
- STRIP_NAME_ENCODING (str, origstr);
+ str = (* targetm.strip_name_encoding) (origstr);
if (is_plt)
{
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index c72b0dd..1407729 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -59,6 +59,7 @@ extern void machopic_define_name PARAMS ((const char*));
extern int machopic_name_defined_p PARAMS ((const char*));
extern int machopic_ident_defined_p PARAMS ((tree));
extern void darwin_encode_section_info PARAMS ((tree, int));
+extern const char *darwin_strip_name_encoding PARAMS ((const char *));
#endif /* TREE_CODE */
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index e6fe420..3b9ee8c 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -278,7 +278,7 @@ machopic_non_lazy_ptr_name (name)
return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
}
- STRIP_NAME_ENCODING (name, name);
+ name = darwin_strip_name_encoding (name);
/* Try again, but comparing names this time. */
for (temp = machopic_non_lazy_pointers;
@@ -288,7 +288,7 @@ machopic_non_lazy_ptr_name (name)
if (TREE_VALUE (temp))
{
temp_name = IDENTIFIER_POINTER (TREE_VALUE (temp));
- STRIP_NAME_ENCODING (temp_name, temp_name);
+ temp_name = darwin_strip_name_encoding (temp_name);
if (strcmp (name, temp_name) == 0)
return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
}
@@ -360,7 +360,7 @@ machopic_stub_name (name)
return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
}
- STRIP_NAME_ENCODING (name, name);
+ name = darwin_strip_name_encoding (name);
{
char *buffer;
@@ -414,7 +414,8 @@ machopic_validate_stub_or_non_lazy_ptr (name, validate_stub)
TREE_USED (temp) = 1;
if (TREE_CODE (TREE_VALUE (temp)) == IDENTIFIER_NODE)
TREE_SYMBOL_REFERENCED (TREE_VALUE (temp)) = 1;
- STRIP_NAME_ENCODING (real_name, IDENTIFIER_POINTER (TREE_VALUE (temp)));
+ real_name = IDENTIFIER_POINTER (TREE_VALUE (temp));
+ real_name = darwin_strip_name_encoding (real_name);
id2 = maybe_get_identifier (real_name);
if (id2)
TREE_SYMBOL_REFERENCED (id2) = 1;
@@ -846,7 +847,7 @@ machopic_finish (asm_out_file)
if (sym_name[0] == '!' && sym_name[1] == 'T')
continue;
- STRIP_NAME_ENCODING (sym_name, sym_name);
+ sym_name = darwin_strip_name_encoding (sym_name);
sym = alloca (strlen (sym_name) + 2);
if (sym_name[0] == '*' || sym_name[0] == '&')
@@ -1015,6 +1016,15 @@ darwin_encode_section_info (decl, first)
update_stubs (XSTR (sym_ref, 0));
}
+/* Undo the effects of the above. */
+
+const char *
+darwin_strip_name_encoding (str)
+ const char *str;
+{
+ return str[0] == '!' ? str + 4 : str;
+}
+
/* Scan the list of non-lazy pointers and update any recorded names whose
stripped name matches the argument. */
@@ -1025,7 +1035,7 @@ update_non_lazy_ptrs (name)
const char *name1, *name2;
tree temp;
- STRIP_NAME_ENCODING (name1, name);
+ name1 = darwin_strip_name_encoding (name);
for (temp = machopic_non_lazy_pointers;
temp != NULL_TREE;
@@ -1035,7 +1045,7 @@ update_non_lazy_ptrs (name)
if (*sym_name == '!')
{
- STRIP_NAME_ENCODING (name2, sym_name);
+ name2 = darwin_strip_name_encoding (sym_name);
if (strcmp (name1, name2) == 0)
{
IDENTIFIER_POINTER (TREE_VALUE (temp)) = name;
@@ -1089,7 +1099,7 @@ update_stubs (name)
const char *name1, *name2;
tree temp;
- STRIP_NAME_ENCODING (name1, name);
+ name1 = darwin_strip_name_encoding (name);
for (temp = machopic_stubs;
temp != NULL_TREE;
@@ -1099,7 +1109,7 @@ update_stubs (name)
if (*sym_name == '!')
{
- STRIP_NAME_ENCODING (name2, sym_name);
+ name2 = darwin_strip_name_encoding (sym_name);
if (strcmp (name1, name2) == 0)
{
IDENTIFIER_POINTER (TREE_VALUE (temp)) = name;
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 14ab0ff..0de2414 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -235,28 +235,28 @@ do { text_section (); \
Make Objective-C internal symbols local. */
#undef ASM_OUTPUT_LABELREF
-#define ASM_OUTPUT_LABELREF(FILE,NAME) \
- do { \
- STRIP_NAME_ENCODING (NAME, NAME); \
- if (NAME[0] == '&' || NAME[0] == '*') \
- { \
- int len = strlen (NAME); \
- if (len > 6 && !strcmp ("$stub", NAME + len - 5)) \
- machopic_validate_stub_or_non_lazy_ptr (NAME, 1); \
- else if (len > 7 && !strcmp ("$stub\"", NAME + len - 6)) \
- machopic_validate_stub_or_non_lazy_ptr (NAME, 1); \
- else if (len > 14 && !strcmp ("$non_lazy_ptr", NAME + len - 13)) \
- machopic_validate_stub_or_non_lazy_ptr (NAME, 0); \
- fputs (&NAME[1], FILE); \
- } \
- else if (NAME[0] == '+' || NAME[0] == '-') \
- fprintf (FILE, "\"%s\"", NAME); \
- else if (!strncmp (NAME, "_OBJC_", 6)) \
- fprintf (FILE, "L%s", NAME); \
- else if (!strncmp (NAME, ".objc_class_name_", 17)) \
- fprintf (FILE, "%s", NAME); \
- else \
- fprintf (FILE, "_%s", NAME); \
+#define ASM_OUTPUT_LABELREF(FILE,NAME) \
+ do { \
+ const char *xname = darwin_strip_name_encoding (NAME); \
+ if (xname[0] == '&' || xname[0] == '*') \
+ { \
+ int len = strlen (xname); \
+ if (len > 6 && !strcmp ("$stub", xname + len - 5)) \
+ machopic_validate_stub_or_non_lazy_ptr (xname, 1); \
+ else if (len > 7 && !strcmp ("$stub\"", xname + len - 6)) \
+ machopic_validate_stub_or_non_lazy_ptr (xname, 1); \
+ else if (len > 14 && !strcmp ("$non_lazy_ptr", xname + len - 13)) \
+ machopic_validate_stub_or_non_lazy_ptr (xname, 0); \
+ fputs (&xname[1], FILE); \
+ } \
+ else if (xname[0] == '+' || xname[0] == '-') \
+ fprintf (FILE, "\"%s\"", xname); \
+ else if (!strncmp (xname, "_OBJC_", 6)) \
+ fprintf (FILE, "L%s", xname); \
+ else if (!strncmp (xname, ".objc_class_name_", 17)) \
+ fprintf (FILE, "%s", xname); \
+ else \
+ fprintf (FILE, "_%s", xname); \
} while (0)
#undef ALIGN_ASM_OP
@@ -553,9 +553,7 @@ enum machopic_addr_class {
#define MACHOPIC_PURE (flag_pic == 2)
#define TARGET_ENCODE_SECTION_INFO darwin_encode_section_info
-
-#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
- ((VAR) = ((SYMBOL_NAME[0] == '!') ? (SYMBOL_NAME) + 4 : (SYMBOL_NAME)))
+#define TARGET_STRIP_NAME_ENCODING darwin_strip_name_encoding
#define GEN_BINDER_NAME_FOR_STUB(BUF,STUB,STUB_LENGTH) \
do { \
@@ -591,12 +589,11 @@ enum machopic_addr_class {
#define GEN_LAZY_PTR_NAME_FOR_SYMBOL(BUF,SYMBOL,SYMBOL_LENGTH) \
do { \
- const char *symbol_ = (SYMBOL); \
+ const char *symbol_ = darwin_strip_name_encoding (SYMBOL); \
char *buffer_ = (BUF); \
- STRIP_NAME_ENCODING (symbol_, symbol_); \
if (symbol_[0] == '"') \
{ \
- strcpy (buffer_, "\"L"); \
+ strcpy (buffer_, "\"L"); \
strcpy (buffer_ + 2, symbol_ + 1); \
strcpy (buffer_ + (SYMBOL_LENGTH), "$lazy_ptr\""); \
} \
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 64d4e85..bb78d4bb 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -66,6 +66,7 @@ static void h8300_asm_named_section PARAMS ((const char *, unsigned int));
#endif
static void h8300_encode_label PARAMS ((tree));
static void h8300_encode_section_info PARAMS ((tree, int));
+static const char *h8300_strip_name_encoding PARAMS ((const char *));
/* CPU_TYPE, says what cpu we're compiling for. */
int cpu_type;
@@ -115,6 +116,8 @@ const char *h8_push_op, *h8_pop_op, *h8_mov_op;
#define TARGET_ASM_FUNCTION_EPILOGUE h8300_output_function_epilogue
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO h8300_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING h8300_strip_name_encoding
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -3477,6 +3480,15 @@ h8300_encode_section_info (decl, first)
}
}
+/* Undo the effects of the above. */
+
+static const char *
+h8300_strip_name_encoding (str)
+ const char *str;
+{
+ return str + (*str == '*' || *str == '@' || *str == '&');
+}
+
const char *
output_simode_bld (bild, operands)
int bild;
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 1baa959..6a888a9 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -1096,13 +1096,6 @@ struct cum_arg
#define TINY_DATA_NAME_P(NAME) (*(NAME) == '&')
-/* Store the user-specified part of SYMBOL_NAME in VAR.
- This is sort of inverse to targetm.encode_section_info. */
-#define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME) \
- (VAR) = (SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*' \
- || (SYMBOL_NAME)[0] == '@' \
- || (SYMBOL_NAME)[0] == '&');
-
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */
diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
index 7098066..0caf3c3 100644
--- a/gcc/config/i386/cygwin.h
+++ b/gcc/config/i386/cygwin.h
@@ -255,45 +255,16 @@ do { \
section and we need to set DECL_SECTION_NAME so we do that here.
Note that we can be called twice on the same decl. */
-extern void i386_pe_encode_section_info PARAMS ((TREE, int));
-
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO i386_pe_encode_section_info
-
-/* Utility used only in this file. */
-#define I386_PE_STRIP_ENCODING(SYM_NAME) \
- ((SYM_NAME) + ((SYM_NAME)[0] == '@' \
- ? ((SYM_NAME)[3] == '*' ? 4 : 3) : 0) \
- + ((SYM_NAME)[0] == '*' ? 1 : 0))
-
-/* This macro gets just the user-specified name
- out of the string in a SYMBOL_REF. Discard
- trailing @[NUM] encoded by targetm.encode_section_info. */
-#undef STRIP_NAME_ENCODING
-#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
-do { \
- const char *_p; \
- const char *_name = I386_PE_STRIP_ENCODING (SYMBOL_NAME); \
- for (_p = _name; *_p && *_p != '@'; ++_p) \
- ; \
- if (*_p == '@') \
- { \
- int _len = _p - _name; \
- char *_new_name = (char *) alloca (_len + 1); \
- strncpy (_new_name, _name, _len); \
- _new_name[_len] = '\0'; \
- (VAR) = _new_name; \
- } \
- else \
- (VAR) = _name; \
-} while (0)
-
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING i386_pe_strip_name_encoding_full
/* Output a reference to a label. */
#undef ASM_OUTPUT_LABELREF
#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, \
- I386_PE_STRIP_ENCODING (NAME)) \
+ i386_pe_strip_name_encoding (NAME)) \
/* Output a common block. */
#undef ASM_OUTPUT_COMMON
diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h
index fb0a9a9..630a7b9 100644
--- a/gcc/config/i386/i386-interix.h
+++ b/gcc/config/i386/i386-interix.h
@@ -299,40 +299,13 @@ while (0)
/* Define this macro if references to a symbol must be treated
differently depending on something about the variable or
- function named by the symbol (such as what section it is in).
-
- Apply stddef, handle (as yet unimplemented) pic.
-
- stddef renaming does NOT apply to Alpha. */
-
-const char *gen_stdcall_suffix PARAMS ((tree));
-void i386_interix_encode_section_info PARAMS ((tree, int));
+ function named by the symbol (such as what section it is in). */
#undef TARGET_ENCODE_SECTION_INFO
-#define TARGET_ENCODE_SECTION_INFO i386_interix_encode_section_info
-
-/* This macro gets just the user-specified name
- out of the string in a SYMBOL_REF. Discard
- trailing @[NUM] encoded by targetm.encode_section_info. */
-#undef STRIP_NAME_ENCODING
-#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
-do { \
- const char *_p; \
- const char *_name = SYMBOL_NAME; \
- for (_p = _name; *_p && *_p != '@'; ++_p) \
- ; \
- if (*_p == '@') \
- { \
- int _len = _p - _name; \
- char *_new_name = (char *) alloca (_len + 1); \
- strncpy (_new_name, _name, _len); \
- _new_name[_len] = '\0'; \
- (VAR) = _new_name; \
- } \
- else \
- (VAR) = _name; \
-} while (0)
-
+#define TARGET_ENCODE_SECTION_INFO i386_pe_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING i386_pe_strip_name_encoding_full
+
#if 0
/* Turn this back on when the linker is updated to handle grouped
.data$ sections correctly. See corresponding note in i386/interix.c.
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index b3b1688..4222bba 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -199,3 +199,8 @@ extern unsigned int i386_pe_section_type_flags PARAMS ((tree, const char *,
extern void i386_pe_asm_named_section PARAMS ((const char *, unsigned int));
extern void x86_output_mi_thunk PARAMS ((FILE *, int, tree));
#endif
+
+/* In winnt.c */
+extern void i386_pe_encode_section_info PARAMS ((tree, int));
+extern const char *i386_pe_strip_name_encoding PARAMS ((const char *));
+extern const char *i386_pe_strip_name_encoding_full PARAMS ((const char *));
diff --git a/gcc/config/i386/interix.c b/gcc/config/i386/interix.c
index dc9c3d6..58a19ab 100644
--- a/gcc/config/i386/interix.c
+++ b/gcc/config/i386/interix.c
@@ -102,8 +102,7 @@ i386_pe_unique_section (decl, reloc)
char *string,*prefix;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
- /* Strip off any encoding in fnname. */
- STRIP_NAME_ENCODING (name, name);
+ name = (* targetm.strip_name_encoding) (name);
/* The object is put in, for example, section .text$foo.
The linker will then ultimately place them in .text
diff --git a/gcc/config/i386/win32.h b/gcc/config/i386/win32.h
index 03ed495..a9a8b2d 100644
--- a/gcc/config/i386/win32.h
+++ b/gcc/config/i386/win32.h
@@ -104,30 +104,8 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO i386_pe_encode_section_info
-
-/* This macro gets just the user-specified name
- out of the string in a SYMBOL_REF. Discard
- trailing @[NUM] encoded by targetm.encode_section_info.
- Do we need the stripping of leading '*'? */
-#undef STRIP_NAME_ENCODING
-#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
-do { \
- const char *_p; \
- const char *const _name = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*'));\
- for (_p = _name; *_p && *_p != '@'; ++_p) \
- ; \
- if (*_p == '@') \
- { \
- int _len = _p - _name; \
- char *_new_name = (char *) alloca (_len + 1); \
- strncpy (_new_name, _name, _len); \
- _new_name[_len] = '\0'; \
- (VAR) = _new_name; \
- } \
- else \
- (VAR) = _name; \
-} while (0)
-
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING i386_pe_strip_name_encoding_full
/* Emit code to check the stack when allocating more that 4000
bytes in one go. */
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index d88e7db..d6f0a7a 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "tm_p.h"
#include "toplev.h"
#include "hashtab.h"
+#include "ggc.h"
/* i386/PE specific attribute support.
@@ -422,6 +423,35 @@ i386_pe_encode_section_info (decl, first)
}
}
+/* Strip only the leading encoding, leaving the stdcall suffix. */
+
+const char *
+i386_pe_strip_name_encoding (str)
+ const char *str;
+{
+ if (*str == '@')
+ str += 3;
+ if (*str == '*')
+ str += 1;
+ return str;
+}
+
+/* Also strip the stdcall suffix. */
+
+const char *
+i386_pe_strip_name_encoding_full (str)
+ const char *str;
+{
+ const char *p;
+ const char *name = i386_pe_strip_name_encoding (str);
+
+ p = strchr (name, '@');
+ if (p)
+ return ggc_alloc_string (name, p - name);
+
+ return name;
+}
+
void
i386_pe_unique_section (decl, reloc)
tree decl;
@@ -432,8 +462,7 @@ i386_pe_unique_section (decl, reloc)
char *string;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
- /* Strip off any encoding in fnname. */
- STRIP_NAME_ENCODING (name, name);
+ name = i386_pe_strip_name_encoding_full (name);
/* The object is put in, for example, section .text$foo.
The linker will then ultimately place them in .text
@@ -663,7 +692,7 @@ i386_pe_asm_file_end (file)
for (q = export_head; q != NULL; q = q->next)
{
fprintf (file, "\t.ascii \" -export:%s%s\"\n",
- I386_PE_STRIP_ENCODING (q->name),
+ i386_pe_strip_name_encoding (q->name),
(q->is_data) ? ",data" : "");
}
}
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index f62f92a..2d01810 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -127,6 +127,7 @@ static void emit_all_insn_group_barriers PARAMS ((FILE *, rtx));
static void emit_predicate_relation_info PARAMS ((void));
static bool ia64_in_small_data_p PARAMS ((tree));
static void ia64_encode_section_info PARAMS ((tree, int));
+static const char *ia64_strip_name_encoding PARAMS ((const char *));
static void process_epilogue PARAMS ((void));
static int process_set PARAMS ((FILE *, rtx));
@@ -211,6 +212,8 @@ static const struct attribute_spec ia64_attribute_table[] =
#define TARGET_IN_SMALL_DATA_P ia64_in_small_data_p
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO ia64_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING ia64_strip_name_encoding
#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST ia64_adjust_cost
@@ -6981,6 +6984,17 @@ ia64_encode_section_info (decl, first)
else if (symbol_str[0] == SDATA_NAME_FLAG_CHAR)
XSTR (symbol, 0) = ggc_strdup (symbol_str + 1);
}
+
+static const char *
+ia64_strip_name_encoding (str)
+ const char *str;
+{
+ if (str[0] == SDATA_NAME_FLAG_CHAR)
+ str++;
+ if (str[0] == '*')
+ str++;
+ return str;
+}
/* Output assembly directives for prologue regions. */
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index eaa1a7d..0d3d362 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1777,18 +1777,6 @@ do { \
#define SDATA_NAME_FLAG_CHAR '@'
#define IA64_DEFAULT_GVALUE 8
-
-/* Decode SYM_NAME and store the real name part in VAR, sans the characters
- that encode section info. */
-
-#define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME) \
-do { \
- (VAR) = (SYMBOL_NAME); \
- if ((VAR)[0] == SDATA_NAME_FLAG_CHAR) \
- (VAR)++; \
- if ((VAR)[0] == '*') \
- (VAR)++; \
-} while (0)
/* Position Independent Code. */
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 6140d0f..b7ebaf3 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -76,7 +76,7 @@ static int m32r_issue_rate PARAMS ((void));
static void m32r_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT));
static void m32r_encode_section_info PARAMS ((tree, int));
-
+static const char *m32r_strip_name_encoding PARAMS ((const char *));
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
@@ -107,6 +107,8 @@ static void m32r_encode_section_info PARAMS ((tree, int));
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO m32r_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING m32r_strip_name_encoding
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -486,6 +488,17 @@ m32r_encode_section_info (decl, first)
}
}
+/* Undo the effects of the above. */
+
+static const char *
+m32r_strip_name_encoding (str)
+ const char *str;
+{
+ str += ENCODED_NAME_P (str);
+ str += *str == '*';
+ return str;
+}
+
/* Do anything needed before RTL is emitted for each function. */
void
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index 2d2b637..d055deb 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -1611,15 +1611,6 @@ sbss_section () \
/*|| SMALL_NAME_P (SYMBOL_NAME)*/ \
|| MEDIUM_NAME_P (SYMBOL_NAME) \
|| LARGE_NAME_P (SYMBOL_NAME))
-
-/* Decode SYM_NAME and store the real name part in VAR, sans
- the characters that encode section info. */
-/* Note that we have to handle symbols like "%*start". */
-#define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME) \
-do { \
- (VAR) = (SYMBOL_NAME) + ENCODED_NAME_P (SYMBOL_NAME); \
- (VAR) += *(VAR) == '*'; \
-} while (0)
/* PIC */
@@ -1707,14 +1698,8 @@ do { \
/* This is how to output a reference to a user-level label named NAME.
`assemble_name' uses this. */
#undef ASM_OUTPUT_LABELREF
-#define ASM_OUTPUT_LABELREF(FILE, NAME) \
- do \
- { \
- const char * real_name; \
- STRIP_NAME_ENCODING (real_name, (NAME)); \
- asm_fprintf (FILE, "%U%s", real_name); \
- } \
- while (0)
+#define ASM_OUTPUT_LABELREF(FILE, NAME) \
+ asm_fprintf (FILE, "%U%s", (*targetm.strip_name_encoding) (NAME))
/* If -Os, don't force line number labels to begin at the beginning of
the word; we still want the assembler to try to put things in parallel,
diff --git a/gcc/config/mcore/mcore-elf.h b/gcc/config/mcore/mcore-elf.h
index 2cdbae0..ced4886 100644
--- a/gcc/config/mcore/mcore-elf.h
+++ b/gcc/config/mcore/mcore-elf.h
@@ -67,7 +67,7 @@ exports_section () \
{ \
exports_section (); \
fprintf (STREAM, "\t.ascii \" -export:%s\"\n", \
- MCORE_STRIP_NAME_ENCODING (NAME)); \
+ (* targetm.strip_name_encoding) (NAME)); \
} \
while (0);
diff --git a/gcc/config/mcore/mcore-pe.h b/gcc/config/mcore/mcore-pe.h
index 651f338..6668574 100644
--- a/gcc/config/mcore/mcore-pe.h
+++ b/gcc/config/mcore/mcore-pe.h
@@ -69,7 +69,7 @@ drectve_section () \
{ \
drectve_section (); \
fprintf (STREAM, "\t.ascii \" -export:%s\"\n", \
- MCORE_STRIP_NAME_ENCODING (NAME)); \
+ (* targetm.strip_name_encoding) (NAME)); \
} \
while (0);
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index 61fc5bd..7276d81 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -139,6 +139,7 @@ static void mcore_asm_named_section PARAMS ((const char *,
#endif
static void mcore_unique_section PARAMS ((tree, int));
static void mcore_encode_section_info PARAMS ((tree, int));
+static const char *mcore_strip_name_encoding PARAMS ((const char *));
/* Initialize the GCC target structure. */
#ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES
@@ -159,6 +160,8 @@ static void mcore_encode_section_info PARAMS ((tree, int));
#define TARGET_ASM_UNIQUE_SECTION mcore_unique_section
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO mcore_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING mcore_strip_name_encoding
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -3467,6 +3470,15 @@ mcore_encode_section_info (decl, first)
}
}
+/* Undo the effects of the above. */
+
+static const char *
+mcore_strip_name_encoding (str)
+ const char *str;
+{
+ return str + (str[0] == '@' ? 3 : 0);
+}
+
/* MCore specific attribute support.
dllexport - for exporting a function/variable that will live in a dll
dllimport - for importing a function/variable from a dll
@@ -3535,7 +3547,7 @@ mcore_unique_section (decl, reloc)
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
/* Strip off any encoding in name. */
- STRIP_NAME_ENCODING (name, name);
+ name = (* targetm.strip_name_encoding) (name);
/* The object is put in, for example, section .text$foo.
The linker will then ultimately place them in .text
diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h
index da9d20c..682039e 100644
--- a/gcc/config/mcore/mcore.h
+++ b/gcc/config/mcore/mcore.h
@@ -1119,8 +1119,8 @@ switch_to_section (section, decl) \
/* Output a reference to a label. */
#undef ASM_OUTPUT_LABELREF
#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
- fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, MCORE_STRIP_NAME_ENCODING (NAME))
-
+ fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, \
+ (* targetm.strip_name_encoding) (NAME))
/* This is how to output an assembler line
that says to advance the location counter
@@ -1133,16 +1133,6 @@ switch_to_section (section, decl) \
#define ASM_DECLARE_RESULT(FILE, RESULT)
#endif
-/* Strip export encoding from a function name. */
-#define MCORE_STRIP_NAME_ENCODING(SYM_NAME) \
- ((SYM_NAME) + ((SYM_NAME)[0] == '@' ? 3 : 0))
-
-/* Strip any text from SYM_NAME added by targetm.encode_section_info
- and store the result in VAR. */
-#undef STRIP_NAME_ENCODING
-#define STRIP_NAME_ENCODING(VAR, SYM_NAME) \
- (VAR) = MCORE_STRIP_NAME_ENCODING (SYM_NAME)
-
#define MULTIPLE_SYMBOL_SPACES 1
#define SUPPORTS_ONE_ONLY 1
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 123028c..9bcca17 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -10285,8 +10285,8 @@ mips_unique_section (decl, reloc)
};
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ name = (* targetm.strip_name_encoding) (name);
size = int_size_in_bytes (TREE_TYPE (decl));
- STRIP_NAME_ENCODING (name, name);
/* Determine the base section we are interested in:
0=text, 1=rodata, 2=data, 3=sdata, [4=bss]. */
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index baa0849..51f91ee 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -33,7 +33,6 @@ extern int mmix_register_move_cost
PARAMS ((enum machine_mode, enum reg_class, enum reg_class));
extern const char *mmix_text_section_asm_op PARAMS ((void));
extern const char *mmix_data_section_asm_op PARAMS ((void));
-extern const char *mmix_strip_name_encoding PARAMS ((const char *));
extern void mmix_asm_file_start PARAMS ((FILE *));
extern void mmix_asm_file_end PARAMS ((FILE *));
extern void mmix_asm_output_source_filename PARAMS ((FILE *, const char *));
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index d798fa9..74c5b72 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -99,6 +99,7 @@ static void mmix_output_octa PARAMS ((FILE *, HOST_WIDEST_INT, int));
static bool mmix_assemble_integer PARAMS ((rtx, unsigned int, int));
static void mmix_init_machine_status PARAMS ((struct function *));
static void mmix_encode_section_info PARAMS ((tree, int));
+static const char *mmix_strip_name_encoding PARAMS ((const char *));
extern void mmix_target_asm_function_prologue
PARAMS ((FILE *, HOST_WIDE_INT));
@@ -130,6 +131,8 @@ extern void mmix_target_asm_function_epilogue
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO mmix_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING mmix_strip_name_encoding
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -1768,9 +1771,7 @@ mmix_encode_section_info (decl, first)
}
}
-/* STRIP_NAME_ENCODING. */
-
-const char *
+static const char *
mmix_strip_name_encoding (name)
const char *name;
{
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 9eb968b..0f9d5b7 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -907,9 +907,6 @@ typedef struct { int regs; int lib; int now_varargs; } CUMULATIVE_ARGS;
#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata"
-#define STRIP_NAME_ENCODING(VAR, SYM_NAME) \
- (VAR) = mmix_strip_name_encoding (SYM_NAME)
-
/* Node: PIC */
/* (empty) */
diff --git a/gcc/config/mn10200/mn10200.h b/gcc/config/mn10200/mn10200.h
index 1356fd0..16f5f82 100644
--- a/gcc/config/mn10200/mn10200.h
+++ b/gcc/config/mn10200/mn10200.h
@@ -830,12 +830,8 @@ struct cum_arg { int nbytes; };
`assemble_name' uses this. */
#undef ASM_OUTPUT_LABELREF
-#define ASM_OUTPUT_LABELREF(FILE, NAME) \
- do { \
- const char* real_name; \
- STRIP_NAME_ENCODING (real_name, (NAME)); \
- fprintf (FILE, "_%s", real_name); \
- } while (0)
+#define ASM_OUTPUT_LABELREF(FILE, NAME) \
+ fprintf (FILE, "_%s", (*targetm.strip_name_encoding) (NAME))
/* Store in OUTPUT a string (made with alloca) containing
an assembler-name for a local static variable named NAME.
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 2c1dc7a..ddebedd 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -911,12 +911,8 @@ struct cum_arg {int nbytes; };
`assemble_name' uses this. */
#undef ASM_OUTPUT_LABELREF
-#define ASM_OUTPUT_LABELREF(FILE, NAME) \
- do { \
- const char* real_name; \
- STRIP_NAME_ENCODING (real_name, (NAME)); \
- fprintf (FILE, "_%s", real_name); \
- } while (0)
+#define ASM_OUTPUT_LABELREF(FILE, NAME) \
+ fprintf (FILE, "_%s", (*targetm.strip_name_encoding) (NAME))
/* Store in OUTPUT a string (made with alloca) containing
an assembler-name for a local static variable named NAME.
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index d12c1be..41e5dc0 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -117,6 +117,7 @@ static int pa_issue_rate PARAMS ((void));
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 *));
/* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */
@@ -188,6 +189,8 @@ int n_deferred_plabels = 0;
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO pa_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING pa_strip_name_encoding
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -6285,7 +6288,7 @@ output_call (insn, call_dest, sibcall)
/* Gross. We have just implicitly taken the address of this
function, mark it as such. */
- STRIP_NAME_ENCODING (real_name, name);
+ real_name = (*targetm.strip_name_encoding) (name);
TREE_SYMBOL_REFERENCED (get_identifier (real_name)) = 1;
}
@@ -6460,6 +6463,15 @@ pa_encode_section_info (decl, first)
}
}
+/* This is sort of inverse to pa_encode_section_info. */
+
+static const char *
+pa_strip_name_encoding (str)
+ const char *str;
+{
+ return str + (*str == '*' || *str == '@');
+}
+
int
function_label_operand (op, mode)
rtx op;
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 55e4311..8f432c2 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -864,79 +864,80 @@ struct hppa_args {int words, nargs_prototype, indirect; };
extern struct rtx_def *hppa_compare_op0, *hppa_compare_op1;
extern enum cmp_type hppa_branch_type;
-#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
-{ const char *target_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
- static unsigned int current_thunk_number; \
- char label[16]; \
- char *lab; \
- ASM_GENERATE_INTERNAL_LABEL (label, "LTHN", current_thunk_number); \
- STRIP_NAME_ENCODING (lab, label); \
- STRIP_NAME_ENCODING (target_name, target_name); \
- /* FIXME: total_code_bytes is not handled correctly in files with \
- mi thunks. */ \
- pa_output_function_prologue (FILE, 0); \
- if (VAL_14_BITS_P (DELTA)) \
- { \
- if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
- { \
- fprintf (FILE, "\taddil LT%%%s,%%r19\n", lab); \
- fprintf (FILE, "\tldw RT%%%s(%%r1),%%r22\n", lab); \
- fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
- fprintf (FILE, "\tbb,>=,n %%r22,30,.+16\n"); \
- fprintf (FILE, "\tdepi 0,31,2,%%r22\n"); \
- fprintf (FILE, "\tldw 4(%%sr0,%%r22),%%r19\n"); \
- fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
+#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
+do { \
+ const char *target_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
+ static unsigned int current_thunk_number; \
+ char label[16]; \
+ char *lab; \
+ ASM_GENERATE_INTERNAL_LABEL (label, "LTHN", current_thunk_number); \
+ lab = (*targetm.strip_name_encoding) (label); \
+ target_name = (*targetm.strip_name_encoding) (target_name); \
+ /* FIXME: total_code_bytes is not handled correctly in files with \
+ mi thunks. */ \
+ pa_output_function_prologue (FILE, 0); \
+ if (VAL_14_BITS_P (DELTA)) \
+ { \
+ if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
+ { \
+ fprintf (FILE, "\taddil LT%%%s,%%r19\n", lab); \
+ fprintf (FILE, "\tldw RT%%%s(%%r1),%%r22\n", lab); \
+ fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
+ fprintf (FILE, "\tbb,>=,n %%r22,30,.+16\n"); \
+ fprintf (FILE, "\tdepi 0,31,2,%%r22\n"); \
+ fprintf (FILE, "\tldw 4(%%sr0,%%r22),%%r19\n"); \
+ fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
fprintf (FILE, "\tldsid (%%sr0,%%r22),%%r1\n\tmtsp %%r1,%%sr0\n"); \
- fprintf (FILE, "\tbe 0(%%sr0,%%r22)\n\tldo "); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, "(%%r26),%%r26\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\tb %s\n\tldo ", target_name); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, "(%%r26),%%r26\n"); \
- } \
- } \
- else \
- { \
- if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
- { \
- fprintf (FILE, "\taddil L%%"); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, ",%%r26\n\tldo R%%"); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, "(%%r1),%%r26\n"); \
- fprintf (FILE, "\taddil LT%%%s,%%r19\n", lab); \
- fprintf (FILE, "\tldw RT%%%s(%%r1),%%r22\n", lab); \
- fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
- fprintf (FILE, "\tbb,>=,n %%r22,30,.+16\n"); \
- fprintf (FILE, "\tdepi 0,31,2,%%r22\n"); \
- fprintf (FILE, "\tldw 4(%%sr0,%%r22),%%r19\n"); \
- fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
+ fprintf (FILE, "\tbe 0(%%sr0,%%r22)\n\tldo "); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, "(%%r26),%%r26\n"); \
+ } \
+ else \
+ { \
+ fprintf (FILE, "\tb %s\n\tldo ", target_name); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, "(%%r26),%%r26\n"); \
+ } \
+ } \
+ else \
+ { \
+ if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
+ { \
+ fprintf (FILE, "\taddil L%%"); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, ",%%r26\n\tldo R%%"); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, "(%%r1),%%r26\n"); \
+ fprintf (FILE, "\taddil LT%%%s,%%r19\n", lab); \
+ fprintf (FILE, "\tldw RT%%%s(%%r1),%%r22\n", lab); \
+ fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
+ fprintf (FILE, "\tbb,>=,n %%r22,30,.+16\n"); \
+ fprintf (FILE, "\tdepi 0,31,2,%%r22\n"); \
+ fprintf (FILE, "\tldw 4(%%sr0,%%r22),%%r19\n"); \
+ fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
fprintf (FILE, "\tldsid (%%sr0,%%r22),%%r1\n\tmtsp %%r1,%%sr0\n"); \
- fprintf (FILE, "\tbe,n 0(%%sr0,%%r22)\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\taddil L%%"); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, ",%%r26\n\tb %s\n\tldo R%%", target_name); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, "(%%r1),%%r26\n"); \
- } \
- } \
- fprintf (FILE, "\t.EXIT\n\t.PROCEND\n"); \
- if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
- { \
- data_section (); \
- fprintf (FILE, "\t.align 4\n"); \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "LTHN", current_thunk_number); \
- fprintf (FILE, "\t.word P%%%s\n", target_name); \
- function_section (THUNK_FNDECL); \
- } \
- current_thunk_number++; \
-}
+ fprintf (FILE, "\tbe,n 0(%%sr0,%%r22)\n"); \
+ } \
+ else \
+ { \
+ fprintf (FILE, "\taddil L%%"); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, ",%%r26\n\tb %s\n\tldo R%%", target_name); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, "(%%r1),%%r26\n"); \
+ } \
+ } \
+ fprintf (FILE, "\t.EXIT\n\t.PROCEND\n"); \
+ if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
+ { \
+ data_section (); \
+ fprintf (FILE, "\t.align 4\n"); \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, "LTHN", current_thunk_number); \
+ fprintf (FILE, "\t.word P%%%s\n", target_name); \
+ function_section (THUNK_FNDECL); \
+ } \
+ current_thunk_number++; \
+} while (0)
/* On HPPA, we emit profiling code as rtl via PROFILE_HOOK rather than
as assembly via FUNCTION_PROFILER. Just output a local label.
@@ -1522,13 +1523,6 @@ do { \
#define FUNCTION_NAME_P(NAME) (*(NAME) == '@')
-/* Store the user-specified part of SYMBOL_NAME in VAR.
- This is sort of inverse to targetm.encode_section_info. */
-
-#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
- (VAR) = ((SYMBOL_NAME) \
- + (*(SYMBOL_NAME) == '*' || *(SYMBOL_NAME) == '@'))
-
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
#define CASE_VECTOR_MODE (TARGET_BIG_SWITCH ? TImode : DImode)
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index 7c17ff6..9f0a964 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -131,8 +131,7 @@ do { \
that the section name will have a "." prefix. */
#define ASM_OUTPUT_FUNCTION_PREFIX(FILE, NAME) \
{ \
- const char *name; \
- STRIP_NAME_ENCODING (name, NAME); \
+ const char *name = (*targetm.strip_name_encoding) (NAME); \
if (TARGET_GAS && in_section == in_text) \
fputs ("\t.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n", FILE); \
else if (TARGET_GAS) \
@@ -335,7 +334,7 @@ readonly_data () \
if (!function_label_operand (RTL, VOIDmode)) \
hppa_encode_label (RTL); \
\
- STRIP_NAME_ENCODING (name, XSTR ((RTL), 0)); \
+ name = (*targetm.strip_name_encoding) (XSTR ((RTL), 0)); \
id = maybe_get_identifier (name); \
if (! id || ! TREE_SYMBOL_REFERENCED (id)) \
{ \
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e6e8ef9..1a65a77 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -169,6 +169,7 @@ static void rs6000_elf_unique_section PARAMS ((tree, int));
static void rs6000_elf_select_rtx_section PARAMS ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT));
static void rs6000_elf_encode_section_info PARAMS ((tree, int));
+static const char *rs6000_elf_strip_name_encoding PARAMS ((const char *));
#endif
#ifdef OBJECT_FORMAT_COFF
static void xcoff_asm_named_section PARAMS ((const char *, unsigned int));
@@ -177,6 +178,7 @@ static void rs6000_xcoff_select_section PARAMS ((tree, int,
static void rs6000_xcoff_unique_section PARAMS ((tree, int));
static void rs6000_xcoff_select_rtx_section PARAMS ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT));
+static const char * rs6000_xcoff_strip_name_encoding PARAMS ((const char *));
#endif
static void rs6000_xcoff_encode_section_info PARAMS ((tree, int))
ATTRIBUTE_UNUSED;
@@ -10385,7 +10387,7 @@ output_toc (file, x, labelno, mode)
else
abort ();
- STRIP_NAME_ENCODING (real_name, name);
+ real_name = (*targetm.strip_name_encoding) (name);
if (TARGET_MINIMAL_TOC)
fputs (TARGET_32BIT ? "\t.long " : DOUBLE_INT_ASM_OP, file);
else
@@ -10557,7 +10559,7 @@ output_profile_hook (labelno)
rtx fun;
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
- STRIP_NAME_ENCODING (label_name, ggc_strdup (buf));
+ label_name = (*targetm.strip_name_encoding) (ggc_strdup (buf));
fun = gen_rtx_SYMBOL_REF (Pmode, label_name);
emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1,
@@ -11075,7 +11077,8 @@ rs6000_elf_unique_section (decl, reloc)
}
}
- STRIP_NAME_ENCODING (name, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ name = (*targetm.strip_name_encoding) (name);
prefix = prefixes[sec][DECL_ONE_ONLY (decl)];
len = strlen (name) + strlen (prefix);
string = alloca (len + 1);
@@ -11167,6 +11170,15 @@ rs6000_elf_encode_section_info (decl, first)
}
}
+static const char *
+rs6000_elf_strip_name_encoding (str)
+ const char *str;
+{
+ while (*str == '*' || *str == '@')
+ str++;
+ return str;
+}
+
#endif /* USING_ELFOS_H */
@@ -11432,7 +11444,7 @@ machopic_output_stub (file, symb, stub)
static int label = 0;
/* Lose our funky encoding stuff so it doesn't contaminate the stub. */
- STRIP_NAME_ENCODING (symb, symb);
+ symb = (*targetm.strip_name_encoding) (symb);
label += 1;
@@ -11671,7 +11683,7 @@ rs6000_xcoff_select_section (exp, reloc, align)
static void
rs6000_xcoff_unique_section (decl, reloc)
tree decl;
- int reloc;
+ int reloc ATTRIBUTE_UNUSED;
{
const char *name;
char *string;
@@ -11704,6 +11716,23 @@ rs6000_xcoff_select_rtx_section (mode, x, align)
else
read_only_private_data_section ();
}
+
+/* Remove any trailing [DS] or the like from the symbol name. */
+
+static const char *
+rs6000_xcoff_strip_name_encoding (name)
+ const char *name;
+{
+ size_t len;
+ if (*name == '*')
+ name++;
+ len = strlen (name);
+ if (name[len - 1] == ']')
+ return ggc_alloc_string (name, len - 4);
+ else
+ return name;
+}
+
#endif /* OBJECT_FORMAT_COFF */
/* Note that this is also used for ELF64. */
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 0c601d0..8aee2e2 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -625,7 +625,7 @@ extern int rs6000_pic_labelno;
{ \
const char *desc_name, *orig_name; \
\
- STRIP_NAME_ENCODING (orig_name, NAME); \
+ orig_name = (*targetm.strip_name_encoding) (NAME); \
desc_name = orig_name; \
while (*desc_name == '.') \
desc_name++; \
@@ -776,25 +776,14 @@ extern int fixuplabelno;
/* Historically we have also supported stabs debugging. */
#define DBX_DEBUGGING_INFO
-#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO rs6000_elf_encode_section_info
+#define TARGET_STRIP_NAME_ENCODING rs6000_elf_strip_name_encoding
/* The ELF version doesn't encode [DS] or whatever at the end of symbols. */
#define RS6000_OUTPUT_BASENAME(FILE, NAME) \
assemble_name (FILE, NAME)
-/* This macro gets just the user-specified name
- out of the string in a SYMBOL_REF. Discard
- a leading * or @. */
-#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
-do { \
- const char *_name = SYMBOL_NAME; \
- while (*_name == '*' || *_name == '@') \
- _name++; \
- (VAR) = _name; \
-} while (0)
-
/* This is how to output a reference to a user-level label named NAME.
`assemble_name' uses this. */
diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h
index 211e1fc..90f2727 100644
--- a/gcc/config/rs6000/xcoff.h
+++ b/gcc/config/rs6000/xcoff.h
@@ -163,6 +163,7 @@ toc_section () \
#define TARGET_ASM_SELECT_RTX_SECTION rs6000_xcoff_select_rtx_section
#define TARGET_ENCODE_SECTION_INFO rs6000_xcoff_encode_section_info
+#define TARGET_STRIP_NAME_ENCODING rs6000_xcoff_strip_name_encoding
/* FP save and restore routines. */
#define SAVE_FP_PREFIX "._savef"
@@ -183,13 +184,8 @@ toc_section () \
/* This outputs NAME to FILE up to the first null or '['. */
-#define RS6000_OUTPUT_BASENAME(FILE, NAME) \
- { \
- const char *_p; \
- \
- STRIP_NAME_ENCODING (_p, (NAME)); \
- assemble_name ((FILE), _p); \
- }
+#define RS6000_OUTPUT_BASENAME(FILE, NAME) \
+ assemble_name ((FILE), (*targetm.strip_name_encoding) (NAME))
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
@@ -204,28 +200,6 @@ toc_section () \
do { fputs ("\t.globl ", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); putc ('\n', FILE);} while (0)
-/* Remove any trailing [DS] or the like from the symbol name. */
-
-#define STRIP_NAME_ENCODING(VAR,NAME) \
- do \
- { \
- const char *_name = (NAME); \
- size_t _len; \
- if (*_name == '*') \
- _name++; \
- _len = strlen (_name); \
- if (_name[_len - 1] != ']') \
- (VAR) = _name; \
- else \
- { \
- char *_new_name = (char *) alloca (_len + 1); \
- strcpy (_new_name, _name); \
- _new_name[_len - 4] = '\0'; \
- (VAR) = _new_name; \
- } \
- } \
- while (0)
-
/* Output at beginning of assembler file.
Initialize the section names for the RS/6000 at this point.
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index b84f622..0dafbc3 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -204,6 +204,7 @@ static bool sh_cannot_modify_jumps_p PARAMS ((void));
static bool sh_ms_bitfield_layout_p PARAMS ((tree));
static void sh_encode_section_info PARAMS ((tree, int));
+static const char *sh_strip_name_encoding PARAMS ((const char *));
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
@@ -242,6 +243,11 @@ static void sh_encode_section_info PARAMS ((tree, int));
#undef TARGET_MS_BITFIELD_LAYOUT_P
#define TARGET_MS_BITFIELD_LAYOUT_P sh_ms_bitfield_layout_p
+#undef TARGET_ENCODE_SECTION_INFO
+#define TARGET_ENCODE_SECTION_INFO sh_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING sh_strip_name_encoding
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Print the operand address in x to the stream. */
@@ -6820,3 +6826,14 @@ sh_encode_section_info (decl, first)
if (TARGET_SH5 && first && TREE_CODE (decl) != FUNCTION_DECL)
XEXP (rtl, 0) = gen_datalabel_ref (symbol);
}
+
+/* Undo the effects of the above. */
+
+static const char *
+sh_strip_name_encoding (str)
+ const char *str;
+{
+ STRIP_DATALABEL_ENCODING (str, str);
+ str += *str == '*';
+ return str;
+}
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 0842874..c8e0c08 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -2681,9 +2681,6 @@ while (0)
#define STRIP_DATALABEL_ENCODING(VAR, SYM_NAME) \
(VAR) = (SYM_NAME) + (DATALABEL_SYMNAME_P (SYM_NAME) \
? strlen (SH_DATALABEL_ENCODING) : 0)
-#define STRIP_NAME_ENCODING(VAR, SYM_NAME) \
- STRIP_DATALABEL_ENCODING((VAR), (SYM_NAME)), \
- (VAR) += (*(VAR) == '*')
/* We can't directly access anything that contains a symbol,
nor can we indirect via the constant pool. */
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 7ae92ee..7a6b166 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -2489,10 +2489,6 @@ do { \
This macro is irrelevant if there is no separate readonly data section. */
#define JUMP_TABLES_IN_TEXT_SECTION 1
-
-/* Decode SYM_NAME and store the real name part in VAR, sans the characters
- that encode section info. */
-/* #define STRIP_NAME_ENCODING(VAR, SYM_NAME) */
/* Position Independent Code. */
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index df4d003..e65dae5 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -61,6 +61,7 @@ static void v850_insert_attributes PARAMS ((tree, tree *));
static void v850_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT));
static void v850_encode_data_area PARAMS ((tree));
static void v850_encode_section_info PARAMS ((tree, int));
+static const char *v850_strip_name_encoding PARAMS ((const char *));
/* True if the current function has anonymous arguments. */
int current_function_anonymous_args;
@@ -104,6 +105,8 @@ static int v850_interrupt_p = FALSE;
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO v850_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING v850_strip_name_encoding
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -2218,6 +2221,13 @@ v850_encode_section_info (decl, first)
v850_encode_data_area (decl);
}
+static const char *
+v850_strip_name_encoding (str)
+ const char *str;
+{
+ return str + (ENCODED_NAME_P (str) || *str == '*');
+}
+
/* Return true if the given RTX is a register which can be restored
by a function epilogue. */
int
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 54a1bec..bb753ad 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -1194,13 +1194,8 @@ zbss_section () \
`assemble_name' uses this. */
#undef ASM_OUTPUT_LABELREF
-#define ASM_OUTPUT_LABELREF(FILE, NAME) \
- do { \
- const char* real_name; \
- STRIP_NAME_ENCODING (real_name, (NAME)); \
- asm_fprintf (FILE, "%U%s", real_name); \
- } while (0)
-
+#define ASM_OUTPUT_LABELREF(FILE, NAME) \
+ asm_fprintf (FILE, "%U%s", (*targetm.strip_name_encoding) (NAME))
/* Store in OUTPUT a string (made with alloca) containing
an assembler-name for a local static variable named NAME.
@@ -1427,9 +1422,6 @@ extern union tree_node * GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_K
|| TDA_NAME_P (SYMBOL_NAME) \
|| SDA_NAME_P (SYMBOL_NAME))
-#define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME) \
- (VAR) = (SYMBOL_NAME) + (ENCODED_NAME_P (SYMBOL_NAME) || *(SYMBOL_NAME) == '*')
-
/* Define this if you have defined special-purpose predicates in the
file `MACHINE.c'. This macro is called within an initializer of an
array of structures. The first field in the structure is the name