From 99d3d26e534e11e036364f22ba5614370a4c5f77 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 4 Jul 1994 23:01:31 -0400 Subject: [PATCH] (RS6000_OUTPUT_BASENAME): Always call assembler_name and pass the actual symbol name. From-SVN: r7652 --- gcc/config/rs6000/rs6000.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 5b15aa9042b..ad550a72234 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1818,13 +1818,16 @@ toc_section () \ /* This outputs NAME to FILE up to the first null or '['. */ #define RS6000_OUTPUT_BASENAME(FILE, NAME) \ - if ((NAME)[0] == '*') \ + if ((NAME)[0] == '*' || (NAME)[strlen (NAME) - 1] != ']') \ assemble_name (FILE, NAME); \ else \ { \ - char *_p; \ - for (_p = (NAME); *_p && *_p != '['; _p++) \ - fputc (*_p, FILE); \ + int _len = strlen (NAME); \ + char *_p = alloca (_len + 1); \ + \ + strcpy (_p, NAME); \ + _p[_len - 4] = '\0'; \ + assemble_name (FILE, _p); \ } /* Output something to declare an external symbol to the assembler. Most -- 2.30.2