I read this page in which the author, Chris Siebenmann, states that binaries created using
cgo will not have the
gopclntab or the
gosymtab sections. However, I see that on
go version go1.13.15 linux/amd64, I have built a Go program which links basic c code, using
cgo, and I've confirmed with
radare2 that there is in fact a
.gopclntab section in the resulting binary.
Has there been a change since this article (and the referenced Building a Better Go Linker article) was written? Or is there some other situation in which
cgo may strip these sections? I ask because I have indeed seen other
cgo output binaries that have these sections missing, but I have been unable to reproduce this using my version of the
Aside from just knowing this fact, this information is relevant to reverse engineering go binaries because the
.gopclntab can be used to extract symbol information. In the past, the absence of this table due to
cgo compilation has made it more difficult to do so.