diff options
Diffstat (limited to 'src/debug')
| -rw-r--r-- | src/debug/macho/file.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/debug/macho/file.go b/src/debug/macho/file.go index 16708e5247..085b0c8219 100644 --- a/src/debug/macho/file.go +++ b/src/debug/macho/file.go @@ -473,7 +473,12 @@ func (f *File) parseSymtab(symdat, strtab, cmddat []byte, hdr *SymtabCmd, offset if n.Name >= uint32(len(strtab)) { return nil, &FormatError{offset, "invalid name in symbol table", n.Name} } - sym.Name = cstring(strtab[n.Name:]) + // We add "_" to Go symbols. Strip it here. See issue 33808. + name := cstring(strtab[n.Name:]) + if strings.Contains(name, ".") && name[0] == '_' { + name = name[1:] + } + sym.Name = name sym.Type = n.Type sym.Sect = n.Sect sym.Desc = n.Desc |
