package buildid
import "cmd/go/internal/buildid"
Index ¶
- Variables
- func ReadBuildID(name, target string) (id string, err error)
- func ReadBuildIDFromBinary(filename string) (id string, err error)
- func ReadELFNote(filename, name string, typ int32) ([]byte, error)
Variables ¶
var BuildIDReadSize = 32 * 1024 // changed for testing
Functions ¶
func ReadBuildID ¶
ReadBuildID reads the build ID from an archive or binary. It only supports the gc toolchain. Other toolchain maintainers should adjust this function.
func ReadBuildIDFromBinary ¶
ReadBuildIDFromBinary reads the build ID from a binary.
ELF binaries store the build ID in a proper PT_NOTE section.
Other binary formats are not so flexible. For those, the linker stores the build ID as non-instruction bytes at the very beginning of the text segment, which should appear near the beginning of the file. This is clumsy but fairly portable. Custom locations can be added for other binary types as needed, like we did for ELF.
func ReadELFNote ¶
Source Files ¶
- Version
- v1.9.7
- Published
- Jun 6, 2018
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 1 second ago –
Tools for package owners.