/ go Public
cmd/link: making sense of HeadType #22270
Issues related to the Go compiler and/or runtime.
The path to resolution is known, but the work has not been done.
The linker makes extensive use of HeadType. It does not make much sense to me.
When used as a value, it is very close to meaning
GOOS. One exception is both "android" and "linux" are represented as "Hlinux", but besides that they are equivalent.
When used as a flag to the linker,
-H, it is the value of
GOOS, plus the potential value "windowsgui", which is treated as "windows" except it sets a global linker variable
windowsguito true. The linker is also receiving the
GOOSenvironment variable used by the compiler (and all other tools) to make their OS decision.
-Hflag alone, as other build systems may depend on it.
IsELFglobal variable with
ctxt.HeadType == objabi.ELFinstead.
ctxt.HeadType == objabi.PEGUI.
The text was updated successfully, but these errors were encountered: