sym

Imports

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"

Constants & Variables

AbiSymKindToSymKind var #

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 const #

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_DBL

RV_CHECK_OVERFLOW const #

const RV_CHECK_OVERFLOW RelocVariant = *ast.BinaryExpr

RV_NONE const #

const RV_NONE RelocVariant = iota

RV_POWER_DS const #

const RV_POWER_DS

RV_POWER_HA const #

const RV_POWER_HA

RV_POWER_HI const #

const RV_POWER_HI

RV_POWER_LO const #

const RV_POWER_LO

RV_TYPE_MASK const #

const RV_TYPE_MASK RelocVariant = *ast.BinaryExpr

ReadOnly var #

ReadOnly 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 var #

RelROMap describes the transformation of read-only symbols to rel-ro symbols.

var RelROMap = map[SymKind]SymKind{...}

SBSS const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SBSS

SBUILDINFO const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SBUILDINFO

SCOVERAGE_AUXVAR const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SCOVERAGE_AUXVAR

SCOVERAGE_COUNTER const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SCOVERAGE_COUNTER

SDATA const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDATA

SDATAEND const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDATAEND

SDATAFIPS const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDATAFIPS

SDATAFIPSEND const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDATAFIPSEND

SDATAFIPSSTART const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDATAFIPSSTART

SDWARFABSFCN const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFABSFCN

SDWARFCONST const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFCONST

SDWARFCUINFO const #

DWARF symbol types

const SDWARFCUINFO

SDWARFFCN const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFFCN

SDWARFLINES const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFLINES

SDWARFLOC const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFLOC

SDWARFRANGE const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFRANGE

SDWARFSECT const #

Sections for debugging information

const SDWARFSECT

SDWARFTYPE const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFTYPE

SDWARFVAR const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFVAR

SDYNIMPORT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDYNIMPORT

SELFGOT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SELFGOT

SELFRELROSECT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SELFRELROSECT

SELFROSECT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SELFROSECT

SELFRXSECT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SELFRXSECT

SELFSECT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SELFSECT

SFILEPATH const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SFILEPATH

SFIPSINFO const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SFIPSINFO

SFUNCTAB const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SFUNCTAB

SFUNCTABRELRO const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SFUNCTABRELRO

SFirstWritable const #

Writable sections.

const SFirstWritable

SGCBITS const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SGCBITS

SGCBITSRELRO const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SGCBITSRELRO

SGOFUNC const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SGOFUNC

SGOFUNCRELRO const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SGOFUNCRELRO

SGOSTRING const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SGOSTRING

SGOSTRINGRELRO const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SGOSTRINGRELRO

SHOSTOBJ const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SHOSTOBJ

SINITARR const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SINITARR

SLIBFUZZER_8BIT_COUNTER const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SLIBFUZZER_8BIT_COUNTER

SMACHO const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SMACHO

SMACHOGOT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SMACHOGOT

SMACHOINDIRECTGOT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SMACHOINDIRECTGOT

SMACHOINDIRECTPLT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SMACHOINDIRECTPLT

SMACHOPLT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SMACHOPLT

SMACHOSYMSTR const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SMACHOSYMSTR

SMACHOSYMTAB const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SMACHOSYMTAB

SNOPTRBSS const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SNOPTRBSS

SNOPTRDATA const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SNOPTRDATA

SNOPTRDATAEND const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SNOPTRDATAEND

SNOPTRDATAFIPS const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SNOPTRDATAFIPS

SNOPTRDATAFIPSEND const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SNOPTRDATAFIPSEND

SNOPTRDATAFIPSSTART const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SNOPTRDATAFIPSSTART

SPCLNTAB const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SPCLNTAB

SRODATA const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SRODATA

SRODATAEND const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SRODATAEND

SRODATAFIPS const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SRODATAFIPS

SRODATAFIPSEND const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SRODATAFIPSEND

SRODATAFIPSSTART const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SRODATAFIPSSTART

SRODATARELRO const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SRODATARELRO

SSEHSECT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SSEHSECT

SSEHUNWINDINFO const #

SEH symbol types

const SSEHUNWINDINFO

SSTRING const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SSTRING

SSTRINGRELRO const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SSTRINGRELRO

SSYMTAB const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SSYMTAB

STEXT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const STEXT

STEXTEND const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const STEXTEND

STEXTFIPS const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const STEXTFIPS

STEXTFIPSEND const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const STEXTFIPSEND

STEXTFIPSSTART const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const STEXTFIPSSTART

STLSBSS const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const STLSBSS

STYPE const #

Read-only sections.

const STYPE

STYPERELRO const #

Read-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 STYPERELRO

SUNDEFEXT const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SUNDEFEXT

SWINDOWS const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SWINDOWS

SXCOFFTOC const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SXCOFFTOC

SXREF const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SXREF

Sxxx const #

Defined SymKind values. TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const Sxxx SymKind = iota

SymVerABI0 const #

const SymVerABI0 = 0

SymVerABICount const #

const SymVerABICount = 2

SymVerABIInternal const #

const SymVerABIInternal = 1

SymVerStatic const #

const SymVerStatic = 10

_SymKind_index var #

var _SymKind_index = [...]uint16{...}

_SymKind_name const #

const _SymKind_name = "SxxxSTEXTSTEXTFIPSSTARTSTEXTFIPSSTEXTFIPSENDSTEXTENDSELFRXSECTSMACHOPLTSTYPESSTRINGSGOSTRINGSGOFUNCSGCBITSSRODATASRODATAFIPSSTARTSRODATAFIPSSRODATAFIPSENDSRODATAENDSFUNCTABSELFROSECTSTYPERELROSSTRINGRELROSGOSTRINGRELROSGOFUNCRELROSGCBITSRELROSRODATARELROSFUNCTABRELROSELFRELROSECTSTYPELINKSITABLINKSSYMTABSPCLNTABSFirstWritableSBUILDINFOSFIPSINFOSELFSECTSMACHOSMACHOGOTSWINDOWSSELFGOTSNOPTRDATASNOPTRDATAFIPSSTARTSNOPTRDATAFIPSSNOPTRDATAFIPSENDSNOPTRDATAENDSINITARRSDATASDATAFIPSSTARTSDATAFIPSSDATAFIPSENDSDATAENDSXCOFFTOCSBSSSNOPTRBSSSLIBFUZZER_8BIT_COUNTERSCOVERAGE_COUNTERSCOVERAGE_AUXVARSTLSBSSSXREFSMACHOSYMSTRSMACHOSYMTABSMACHOINDIRECTPLTSMACHOINDIRECTGOTSFILEPATHSDYNIMPORTSHOSTOBJSUNDEFEXTSDWARFSECTSDWARFCUINFOSDWARFCONSTSDWARFFCNSDWARFABSFCNSDWARFTYPESDWARFVARSDWARFRANGESDWARFLOCSDWARFLINESSSEHUNWINDINFOSSEHSECT"

Type Aliases

LoaderSym type #

LoaderSym holds a loader.Sym value. We can't refer to this type from the sym package since loader imports sym.

type LoaderSym uint32

RelocVariant type #

RelocVariant is a linker-internal variation on a relocation.

type RelocVariant uint8

SymKind type #

A SymKind describes the kind of memory represented by a symbol.

type SymKind uint8

Structs

CompilationUnit struct #

A 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
}

Library struct #

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
}

Section struct #

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
}

Segment struct #

type Segment struct {
Rwx uint8
Vaddr uint64
Length uint64
Fileoff uint64
Filelen uint64
Sections []*Section
}

Functions

ABIToVersion function #

func ABIToVersion(abi obj.ABI) int

IsDATA method #

IsDATA returns true if t is one of the SDATA types.

func (t SymKind) IsDATA() bool

IsDWARF method #

func (t SymKind) IsDWARF() bool

IsData method #

IsData returns true if t is any kind of data type.

func (t SymKind) IsData() bool

IsNOPTRDATA method #

IsNOPTRDATA returns true if t is one of the SNOPTRDATA types.

func (t SymKind) IsNOPTRDATA() bool

IsRODATA method #

IsRODATA returns true if t is one of the SRODATA types.

func (t SymKind) IsRODATA() bool

IsText method #

IsText returns true if t is a text type.

func (t SymKind) IsText() bool

RelocName function #

func RelocName(arch *sys.Arch, r objabi.RelocType) string

String method #

func (i SymKind) String() string

String method #

func (l Library) String() string

VersionToABI function #

func VersionToABI(v int) (obj.ABI, bool)

_ function #

func _()

Generated with Arrow