mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: mangle function name with ABI on Mach-O
This is not strictly necessary. But as we already do this on ELF and PE, do it here as well. Updates #40724. Change-Id: Ie6e5211aba116634bc9ed82eb8d22a7fed3b7776 Reviewed-on: https://go-review.googlesource.com/c/go/+/307229 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
9e3328e740
commit
dcf85b30ba
1 changed files with 4 additions and 1 deletions
|
|
@ -1022,7 +1022,10 @@ func machosymtab(ctxt *Link) {
|
||||||
symstr.AddUint8('_')
|
symstr.AddUint8('_')
|
||||||
|
|
||||||
// replace "·" as ".", because DTrace cannot handle it.
|
// replace "·" as ".", because DTrace cannot handle it.
|
||||||
symstr.Addstring(strings.Replace(ldr.SymExtname(s), "·", ".", -1))
|
name := strings.Replace(ldr.SymExtname(s), "·", ".", -1)
|
||||||
|
|
||||||
|
name = mangleABIName(ldr, s, name)
|
||||||
|
symstr.Addstring(name)
|
||||||
|
|
||||||
if t := ldr.SymType(s); t == sym.SDYNIMPORT || t == sym.SHOSTOBJ || t == sym.SUNDEFEXT {
|
if t := ldr.SymType(s); t == sym.SDYNIMPORT || t == sym.SHOSTOBJ || t == sym.SUNDEFEXT {
|
||||||
symtab.AddUint8(0x01) // type N_EXT, external symbol
|
symtab.AddUint8(0x01) // type N_EXT, external symbol
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue