diff options
Diffstat (limited to 'libgo/go/debug/macho/file.go')
-rw-r--r-- | libgo/go/debug/macho/file.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libgo/go/debug/macho/file.go b/libgo/go/debug/macho/file.go index 16708e5247f..085b0c8219b 100644 --- a/libgo/go/debug/macho/file.go +++ b/libgo/go/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 |