aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-06-16 18:33:00 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-06-16 11:33:00 -0700
commitbf20f3410fe9d3e01b0af91bf19cc63a406ca724 (patch)
treec6850003dd535c41255de1ae0694853b38c1d10c /gcc/dwarf2out.c
parent9c0e94a5e42ef58857e03e60756e3f165e4be620 (diff)
downloadgcc-bf20f3410fe9d3e01b0af91bf19cc63a406ca724.zip
gcc-bf20f3410fe9d3e01b0af91bf19cc63a406ca724.tar.gz
gcc-bf20f3410fe9d3e01b0af91bf19cc63a406ca724.tar.bz2
Fix bug reported by tege. section names wrong if USER_LABEL_PREFIX non-null.
* dwarf2out.c (stripattributes): Prepend '*' to the section name. From-SVN: r20529
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 40286de..52f02cd 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -512,17 +512,19 @@ expand_builtin_dwarf_fp_regnum ()
#endif
/* Return a pointer to a copy of the section string name S with all
- attributes stripped off. */
+ attributes stripped off, and an asterisk prepended (for assemble_name). */
static inline char *
stripattributes (s)
char *s;
{
- char *stripped = xstrdup (s);
+ char *stripped = xmalloc (strlen (s) + 2);
char *p = stripped;
- while (*p && *p != ',')
- p++;
+ *p++ = '*';
+
+ while (*s && *s != ',')
+ *p++ = *s++;
*p = '\0';
return stripped;