mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 04:49:54 +08:00
* bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2008-07-07 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char.
|
||||||
|
|
||||||
2008-07-02 Alan Modra <amodra@bigpond.net.au>
|
2008-07-02 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* elf32-ppc.c (is_pic_glink_stub): New function.
|
* elf32-ppc.c (is_pic_glink_stub): New function.
|
||||||
|
21
bfd/bfd.c
21
bfd/bfd.c
@ -1829,10 +1829,12 @@ bfd_demangle (bfd *abfd, const char *name, int options)
|
|||||||
char *res, *alloc;
|
char *res, *alloc;
|
||||||
const char *pre, *suf;
|
const char *pre, *suf;
|
||||||
size_t pre_len;
|
size_t pre_len;
|
||||||
|
bfd_boolean skip_lead;
|
||||||
|
|
||||||
if (abfd != NULL
|
skip_lead = (abfd != NULL
|
||||||
&& *name != '\0'
|
&& *name != '\0'
|
||||||
&& bfd_get_symbol_leading_char (abfd) == *name)
|
&& bfd_get_symbol_leading_char (abfd) == *name);
|
||||||
|
if (skip_lead)
|
||||||
++name;
|
++name;
|
||||||
|
|
||||||
/* This is a hack for better error reporting on XCOFF, PowerPC64-ELF
|
/* This is a hack for better error reporting on XCOFF, PowerPC64-ELF
|
||||||
@ -1863,7 +1865,18 @@ bfd_demangle (bfd *abfd, const char *name, int options)
|
|||||||
free (alloc);
|
free (alloc);
|
||||||
|
|
||||||
if (res == NULL)
|
if (res == NULL)
|
||||||
return NULL;
|
{
|
||||||
|
if (skip_lead)
|
||||||
|
{
|
||||||
|
size_t len = strlen (pre) + 1;
|
||||||
|
alloc = bfd_malloc (len);
|
||||||
|
if (alloc == NULL)
|
||||||
|
return NULL;
|
||||||
|
memcpy (alloc, pre, len);
|
||||||
|
return alloc;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Put back any prefix or suffix. */
|
/* Put back any prefix or suffix. */
|
||||||
if (pre_len != 0 || suf != NULL)
|
if (pre_len != 0 || suf != NULL)
|
||||||
|
Reference in New Issue
Block a user