Re:Purego – A library for calling C functions from Go withou...
by jchw on Sunday February 12, 2023 @01:37PM
(#34765451)
It's name mangling yeah. I believe Go uses those characters in place of where it might use dots.
Re:Purego – A library for calling C functions from Go withou...
by totallygamerjet on Sunday February 12, 2023 @02:22PM
(#34765916)
"In Go object files and binaries, the full name of a symbol is the package path followed by a period and the symbol name: fmt.Printf or math/rand.Int. Because the assembler's parser treats period and slash as punctuation, those strings cannot be used directly as identifier names. Instead, the assembler allows the middle dot character U+00B7 and the division slash U+2215 in identifiers and rewrites them to plain period and slash."[0]
[0] - https://go.dev/doc/asm
Re:Purego – A library for calling C functions from Go withou...
by saagarjha on Monday February 13, 2023 @02:18AM
(#34770988)
This is the most awful thing I’ve encountered all day.
Re:Purego – A library for calling C functions from Go withou...
by phanimahesh on Monday February 13, 2023 @09:04AM
(#34773478)
That's creative. I'm not sure if I should call it abuse, but I'm leaning heavily in favor.
https://github.com/ebitengine/purego/blob/v0.2.0-alpha/sys_d...
I noticed another 0xB7 character in a comment, and sure enough it seems to be part of the identifiers: https://github.com/ebitengine/purego/search?q=runtime%C2%B7c...