You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(There's a "ptxt.From.Sym.Cfunc = 1" assignment in compile/internal/gc/pgen.go, but that's referring to the Cfunc field of an cmd/internal/obj.LSym.)
FWIW, I tracked this check back to https://golang.org/cl/135170044 (0bb14d7), and it appears to have been impossible even then (though less obvious since cmd/cc and cmd/ld used the same LSym type).
@mwhudson Yep, though whereas you were pointing out the code was unneeded after the c2go conversion (until rsc later repurposed it for go:systemstack), I'm pointing out that "cfunc == 1" is (and has always been) impossible within the linker.
Because of an asymmetry between the code responsible for writing cfunc into a Go object file and reading it back in, setting cfunc==1 in the compiler results in setting cfunc==2 in the linker, and there's no other assignments of cfunc=1 within the linker.
cmd/link has this test in a block of code labeled "Mark every Go-called C function with cfunc=2, recursively.":
As far as I can tell, the only assignments to cmd/link/internal/ld.LSym's Cfunc field are:
neither of which can set it to 1.
(There's a "ptxt.From.Sym.Cfunc = 1" assignment in compile/internal/gc/pgen.go, but that's referring to the Cfunc field of an cmd/internal/obj.LSym.)
FWIW, I tracked this check back to https://golang.org/cl/135170044 (0bb14d7), and it appears to have been impossible even then (though less obvious since cmd/cc and cmd/ld used the same LSym type).
CC @rsc @randall77
The text was updated successfully, but these errors were encountered: