Imports #
"cmd/internal/obj"
"internal/buildcfg"
"cmd/internal/objabi"
"strconv"
"cmd/internal/dwarf"
"cmd/internal/goobj"
"cmd/internal/objabi"
"cmd/internal/sys"
"debug/elf"
"debug/macho"
"cmd/internal/obj"
"internal/buildcfg"
"cmd/internal/objabi"
"strconv"
"cmd/internal/dwarf"
"cmd/internal/goobj"
"cmd/internal/objabi"
"cmd/internal/sys"
"debug/elf"
"debug/macho"
AbiSymKindToSymKind maps values read from object files (which are of type cmd/internal/objabi.SymKind) to values of type SymKind.
var AbiSymKindToSymKind = [...]SymKind{...}RV_390_DBL is a s390x-specific relocation variant that indicates that the value to be placed into the relocatable field should first be divided by 2.
const RV_390_DBLconst RV_CHECK_OVERFLOW RelocVariant = *ast.BinaryExprconst RV_NONE RelocVariant = iotaconst RV_POWER_DSconst RV_POWER_HAconst RV_POWER_HIconst RV_POWER_LOconst RV_TYPE_MASK RelocVariant = *ast.BinaryExprReadOnly are the symbol kinds that form read-only sections. In some cases, if they will require relocations, they are transformed into rel-ro sections using relROMap.
var ReadOnly = []SymKind{...}RelROMap describes the transformation of read-only symbols to rel-ro symbols.
var RelROMap = map[SymKind]SymKind{...}Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SBSSDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SBUILDINFODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SCOVERAGE_AUXVARDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SCOVERAGE_COUNTERDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDATADefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDATAENDDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDATAFIPSDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDATAFIPSENDDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDATAFIPSSTARTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDWARFABSFCNDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDWARFCONSTDWARF symbol types
const SDWARFCUINFODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDWARFFCNDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDWARFLINESDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDWARFLOCDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDWARFRANGESections for debugging information
const SDWARFSECTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDWARFTYPEDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDWARFVARDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SDYNIMPORTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SELFGOTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SELFRELROSECTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SELFROSECTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SELFRXSECTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SELFSECTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SFILEPATHDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SFIPSINFODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SFUNCTABDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SFUNCTABRELROWritable sections.
const SFirstWritableDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SGCBITSDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SGCBITSRELRODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SGOFUNCDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SGOFUNCRELRODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SGOSTRINGDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SGOSTRINGRELRODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SHOSTOBJDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SINITARRDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SITABLINKDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SLIBFUZZER_8BIT_COUNTERDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SMACHODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SMACHOGOTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SMACHOINDIRECTGOTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SMACHOINDIRECTPLTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SMACHOPLTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SMACHOSYMSTRDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SMACHOSYMTABDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SNOPTRBSSDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SNOPTRDATADefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SNOPTRDATAENDDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SNOPTRDATAFIPSDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SNOPTRDATAFIPSENDDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SNOPTRDATAFIPSSTARTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SPCLNTABDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SRODATADefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SRODATAENDDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SRODATAFIPSDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SRODATAFIPSENDDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SRODATAFIPSSTARTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SRODATARELRODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SSEHSECTSEH symbol types
const SSEHUNWINDINFODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SSTRINGDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SSTRINGRELRODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SSYMTABDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const STEXTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const STEXTENDDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const STEXTFIPSDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const STEXTFIPSENDDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const STEXTFIPSSTARTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const STLSBSSRead-only sections.
const STYPEPart of .data.rel.ro if it exists, otherwise part of .rodata.
const STYPELINKRead-only sections with relocations. Types STYPE-SFUNCTAB above are written to the .rodata section by default. When linking a shared object, some conceptually "read only" types need to be written to by relocations and putting them in a section called ".rodata" interacts poorly with the system linkers. The GNU linkers support this situation by arranging for sections of the name ".data.rel.ro.XXX" to be mprotected read only by the dynamic linker after relocations have applied, so when the Go linker is creating a shared object it checks all objects of the above types and bumps any object that has a relocation to it to the corresponding type below, which are then written to sections with appropriate magic names.
const STYPERELRODefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SUNDEFEXTDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SWINDOWSDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SXCOFFTOCDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const SXREFDefined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind
const Sxxx SymKind = iotaconst SymVerABI0 = 0const SymVerABICount = 2const SymVerABIInternal = 1const SymVerStatic = 10var _SymKind_index = [...]uint16{...}const _SymKind_name = "SxxxSTEXTSTEXTFIPSSTARTSTEXTFIPSSTEXTFIPSENDSTEXTENDSELFRXSECTSMACHOPLTSTYPESSTRINGSGOSTRINGSGOFUNCSGCBITSSRODATASRODATAFIPSSTARTSRODATAFIPSSRODATAFIPSENDSRODATAENDSFUNCTABSELFROSECTSTYPERELROSSTRINGRELROSGOSTRINGRELROSGOFUNCRELROSGCBITSRELROSRODATARELROSFUNCTABRELROSELFRELROSECTSTYPELINKSITABLINKSSYMTABSPCLNTABSFirstWritableSBUILDINFOSFIPSINFOSELFSECTSMACHOSMACHOGOTSWINDOWSSELFGOTSNOPTRDATASNOPTRDATAFIPSSTARTSNOPTRDATAFIPSSNOPTRDATAFIPSENDSNOPTRDATAENDSINITARRSDATASDATAFIPSSTARTSDATAFIPSSDATAFIPSENDSDATAENDSXCOFFTOCSBSSSNOPTRBSSSLIBFUZZER_8BIT_COUNTERSCOVERAGE_COUNTERSCOVERAGE_AUXVARSTLSBSSSXREFSMACHOSYMSTRSMACHOSYMTABSMACHOINDIRECTPLTSMACHOINDIRECTGOTSFILEPATHSDYNIMPORTSHOSTOBJSUNDEFEXTSDWARFSECTSDWARFCUINFOSDWARFCONSTSDWARFFCNSDWARFABSFCNSDWARFTYPESDWARFVARSDWARFRANGESDWARFLOCSDWARFLINESSSEHUNWINDINFOSSEHSECT"LoaderSym holds a loader.Sym value. We can't refer to this type from the sym package since loader imports sym.
type LoaderSym uint32RelocVariant is a linker-internal variation on a relocation.
type RelocVariant uint8A SymKind describes the kind of memory represented by a symbol.
type SymKind uint8A CompilationUnit represents a set of source files that are compiled together. Since all Go sources in a Go package are compiled together, there's one CompilationUnit per package that represents all Go sources in that package, plus one for each assembly file. Equivalently, there's one CompilationUnit per object file in each Library loaded by the linker. These are used for both DWARF and pclntab generation.
type CompilationUnit struct {
Lib *Library
PclnIndex int
PCs []dwarf.Range
DWInfo *dwarf.DWDie
FileTable []string
Consts LoaderSym
FuncDIEs []LoaderSym
VarDIEs []LoaderSym
AbsFnDIEs []LoaderSym
RangeSyms []LoaderSym
Textp []LoaderSym
}type Library struct {
Objref string
Srcref string
File string
Pkg string
Shlib string
Fingerprint goobj.FingerprintType
Autolib []goobj.ImportedPkg
Imports []*Library
Main bool
Units []*CompilationUnit
Textp []LoaderSym
DupTextSyms []LoaderSym
}type Section struct {
Rwx uint8
Extnum int16
Align int32
Name string
Vaddr uint64
Length uint64
Seg *Segment
Elfsect interface{}
Reloff uint64
Rellen uint64
Relcount uint32
Sym LoaderSym
Index uint16
Compressed bool
}type Segment struct {
Rwx uint8
Vaddr uint64
Length uint64
Fileoff uint64
Filelen uint64
Sections []*Section
}func ABIToVersion(abi obj.ABI) intIsDATA returns true if t is one of the SDATA types.
func (t SymKind) IsDATA() boolfunc (t SymKind) IsDWARF() boolIsData returns true if t is any kind of data type.
func (t SymKind) IsData() boolIsNOPTRDATA returns true if t is one of the SNOPTRDATA types.
func (t SymKind) IsNOPTRDATA() boolIsRODATA returns true if t is one of the SRODATA types.
func (t SymKind) IsRODATA() boolIsText returns true if t is a text type.
func (t SymKind) IsText() boolfunc RelocName(arch *sys.Arch, r objabi.RelocType) stringfunc (i SymKind) String() stringfunc (l Library) String() stringfunc VersionToABI(v int) (obj.ABI, bool)func _()Generated with Arrow