objabi

Imports

Imports #

"strconv"
"fmt"
"strings"
"internal/buildcfg"
"flag"
"fmt"
"internal/bisect"
"internal/buildcfg"
"io"
"log"
"os"
"reflect"
"sort"
"strconv"
"strings"
"internal/abi"
"strings"
"internal/buildcfg"
"os"
"path/filepath"
"runtime"
"strings"
"fmt"
"strconv"
"strings"
"sync"
"strconv"
"fmt"
"internal/abi"
"internal/buildcfg"

Constants & Variables

A_AUTO const #

Auto.name

const A_AUTO = *ast.BinaryExpr

A_DELETED_AUTO const #

Auto.name

const A_DELETED_AUTO

A_PARAM const #

Auto.name

const A_PARAM

ElfRelocOffset const #

const ElfRelocOffset = 256

GlobalDictPrefix const #

const GlobalDictPrefix = ".dict"

Haix const #

const Haix

Hdarwin const #

const Hdarwin

Hdragonfly const #

const Hdragonfly

Hfreebsd const #

const Hfreebsd

Hjs const #

const Hjs

Hlinux const #

const Hlinux

Hnetbsd const #

const Hnetbsd

Hopenbsd const #

const Hopenbsd

Hplan9 const #

const Hplan9

Hsolaris const #

const Hsolaris

Hunknown const #

const Hunknown HeadType = iota

Hwasip1 const #

const Hwasip1

Hwindows const #

const Hwindows

MachoRelocOffset const #

const MachoRelocOffset = 2048

R_ADDR const #

go:generate stringer -type=RelocType

const R_ADDR RelocType = *ast.BinaryExpr

R_ADDRARM64 const #

R_ADDRARM64 relocates an adrp, add pair to compute the address of the referenced symbol.

const R_ADDRARM64

R_ADDRCUOFF const #

R_ADDRCUOFF resolves to a pointer-sized offset from the start of the symbol's DWARF compile unit.

const R_ADDRCUOFF

R_ADDRMIPS const #

R_ADDRMIPS (only used on mips/mips64) resolves to the low 16 bits of an external address, by encoding it into the instruction.

const R_ADDRMIPS

R_ADDRMIPSTLS const #

R_ADDRMIPSTLS (only used on mips64) resolves to the low 16 bits of a TLS address (offset from thread pointer), by encoding it into the instruction.

const R_ADDRMIPSTLS

R_ADDRMIPSU const #

R_ADDRMIPSU (only used on mips/mips64) resolves to the sign-adjusted "upper" 16 bits (bit 16-31) of an external address, by encoding it into the instruction.

const R_ADDRMIPSU

R_ADDROFF const #

R_ADDROFF resolves to a 32-bit offset from the beginning of the section holding the data being relocated to the referenced symbol.

const R_ADDROFF

R_ADDRPOWER const #

R_ADDRPOWER relocates a pair of "D-form" instructions (instructions with 16-bit immediates in the low half of the instruction word), usually addis followed by another add or a load, inserting the "high adjusted" 16 bits of the address of the referenced symbol into the immediate field of the first instruction and the low 16 bits into that of the second instruction.

const R_ADDRPOWER

R_ADDRPOWER_D34 const #

R_ADDRPOWER_D34 relocates a single prefixed D-form load/store operation. All prefixed forms are D form. The high 18 bits are stored in the prefix, and the low 16 are stored in the suffix. The address is absolute.

const R_ADDRPOWER_D34

R_ADDRPOWER_DS const #

R_ADDRPOWER_DS is similar to R_ADDRPOWER above, but assumes the second instruction is a "DS-form" instruction, which has an immediate field occupying bits [15:2] of the instruction word. Bits [15:2] of the address of the relocated symbol are inserted into this field; it is an error if the last two bits of the address are not 0.

const R_ADDRPOWER_DS

R_ADDRPOWER_GOT const #

R_ADDRPOWER_GOT relocates a D-form + DS-form instruction sequence by inserting a relative displacement of referenced symbol's GOT entry to the TOC pointer.

const R_ADDRPOWER_GOT

R_ADDRPOWER_GOT_PCREL34 const #

R_ADDRPOWER_GOT_PCREL34 is identical to R_ADDRPOWER_GOT, but uses a PC relative sequence to generate a GOT symbol addresses.

const R_ADDRPOWER_GOT_PCREL34

R_ADDRPOWER_PCREL const #

R_ADDRPOWER_PCREL relocates two D-form instructions like R_ADDRPOWER, but inserts the displacement from the place being relocated to the address of the relocated symbol instead of just its address.

const R_ADDRPOWER_PCREL

R_ADDRPOWER_PCREL34 const #

R_ADDRPOWER_PCREL34 relates a single prefixed D-form load/store/add operation. All prefixed forms are D form. The resulting address is relative to the PC. It is a signed 34 bit offset.

const R_ADDRPOWER_PCREL34

R_ADDRPOWER_TOCREL const #

R_ADDRPOWER_TOCREL relocates two D-form instructions like R_ADDRPOWER, but inserts the offset from the TOC to the address of the relocated symbol rather than the symbol's address.

const R_ADDRPOWER_TOCREL

R_ADDRPOWER_TOCREL_DS const #

R_ADDRPOWER_TOCREL_DS relocates a D-form, DS-form instruction sequence like R_ADDRPOWER_DS but inserts the offset from the TOC to the address of the relocated symbol rather than the symbol's address.

const R_ADDRPOWER_TOCREL_DS

R_ARM64_GOT const #

R_ARM64_GOT resolves a GOT-relative instruction sequence, usually an adrp followed by another ld instruction.

const R_ARM64_GOT

R_ARM64_GOTPCREL const #

R_ARM64_GOTPCREL relocates an adrp, ld64 pair to compute the address of the GOT slot of the referenced symbol.

const R_ARM64_GOTPCREL

R_ARM64_LDST128 const #

R_ARM64_LDST128 sets a LD/ST immediate value to bits [11:4] of a local address.

const R_ARM64_LDST128

R_ARM64_LDST16 const #

R_ARM64_LDST16 sets a LD/ST immediate value to bits [11:1] of a local address.

const R_ARM64_LDST16

R_ARM64_LDST32 const #

R_ARM64_LDST32 sets a LD/ST immediate value to bits [11:2] of a local address.

const R_ARM64_LDST32

R_ARM64_LDST64 const #

R_ARM64_LDST64 sets a LD/ST immediate value to bits [11:3] of a local address.

const R_ARM64_LDST64

R_ARM64_LDST8 const #

R_ARM64_LDST8 sets a LD/ST immediate value to bits [11:0] of a local address.

const R_ARM64_LDST8

R_ARM64_PCREL const #

R_ARM64_PCREL resolves a PC-relative addresses instruction sequence, usually an adrp followed by another add instruction.

const R_ARM64_PCREL

R_ARM64_PCREL_LDST16 const #

R_ARM64_PCREL_LDST16 resolves a PC-relative addresses instruction sequence, usually an adrp followed by a LD16 or ST16 instruction.

const R_ARM64_PCREL_LDST16

R_ARM64_PCREL_LDST32 const #

R_ARM64_PCREL_LDST32 resolves a PC-relative addresses instruction sequence, usually an adrp followed by a LD32 or ST32 instruction.

const R_ARM64_PCREL_LDST32

R_ARM64_PCREL_LDST64 const #

R_ARM64_PCREL_LDST64 resolves a PC-relative addresses instruction sequence, usually an adrp followed by a LD64 or ST64 instruction.

const R_ARM64_PCREL_LDST64

R_ARM64_PCREL_LDST8 const #

R_ARM64_PCREL_LDST8 resolves a PC-relative addresses instruction sequence, usually an adrp followed by a LD8 or ST8 instruction.

const R_ARM64_PCREL_LDST8

R_ARM64_TLS_IE const #

Relocates an ADRP; LD64 instruction sequence to load the offset between the thread local base and the thread local variable defined by the referenced (thread local) symbol from the GOT.

const R_ARM64_TLS_IE

R_ARM64_TLS_LE const #

Set a MOV[NZ] immediate field to bits [15:0] of the offset from the thread local base to the thread local variable defined by the referenced (thread local) symbol. Error if the offset does not fit into 16 bits.

const R_ARM64_TLS_LE

R_CALL const #

go:generate stringer -type=RelocType

const R_CALL

R_CALLARM const #

go:generate stringer -type=RelocType

const R_CALLARM

R_CALLARM64 const #

go:generate stringer -type=RelocType

const R_CALLARM64

R_CALLIND const #

go:generate stringer -type=RelocType

const R_CALLIND

R_CALLLOONG64 const #

R_CALLLOONG64 resolves to non-PC-relative target address of a CALL (BL/JIRL) instruction, by encoding the address into the instruction.

const R_CALLLOONG64

R_CALLMIPS const #

R_CALLMIPS (only used on mips64) resolves to non-PC-relative target address of a CALL (JAL) instruction, by encoding the address into the instruction.

const R_CALLMIPS

R_CALLPOWER const #

go:generate stringer -type=RelocType

const R_CALLPOWER

R_CONST const #

go:generate stringer -type=RelocType

const R_CONST

R_DWARFFILEREF const #

R_DWARFFILEREF resolves to an index into the DWARF .debug_line file table for the specified file symbol. Must be applied to an attribute of form DW_FORM_data4.

const R_DWARFFILEREF

R_DWARFSECREF const #

R_DWARFSECREF resolves to the offset of the symbol from its section. Target of relocation must be size 4 (in current implementation).

const R_DWARFSECREF

R_GOTOFF const #

go:generate stringer -type=RelocType

const R_GOTOFF

R_GOTPCREL const #

go:generate stringer -type=RelocType

const R_GOTPCREL

R_INITORDER const #

R_INITORDER specifies an ordering edge between two inittask records. (From one p..inittask record to another one.) This relocation does not apply any changes to the actual data, it is just used in the linker to order the inittask records appropriately.

const R_INITORDER

R_JMP16LOONG64 const #

R_JMP16LOONG64 resolves to 18-bit PC-relative target address of a JMP instructions.

const R_JMP16LOONG64

R_JMP21LOONG64 const #

R_JMP21LOONG64 resolves to 23-bit PC-relative target address of a JMP instructions.

const R_JMP21LOONG64

R_JMPLOONG64 const #

R_JMPLOONG64 resolves to non-PC-relative target address of a JMP instruction, by encoding the address into the instruction.

const R_JMPLOONG64

R_JMPMIPS const #

R_JMPMIPS (only used on mips64) resolves to non-PC-relative target address of a JMP instruction, by encoding the address into the instruction. The stack nosplit check ignores this since it is not a function call.

const R_JMPMIPS

R_KEEP const #

R_KEEP tells the linker to keep the referred-to symbol in the final binary if the symbol containing the R_KEEP relocation is in the final binary.

const R_KEEP

R_LOONG64_ADD64 const #

64-bit in-place addition.

const R_LOONG64_ADD64

R_LOONG64_ADDR_HI const #

R_LOONG64_ADDR_HI resolves to the sign-adjusted "upper" 20 bits (bit 5-24) of an external address, by encoding it into the instruction. R_LOONG64_ADDR_LO resolves to the low 12 bits of an external address, by encoding it into the instruction.

const R_LOONG64_ADDR_HI

R_LOONG64_ADDR_LO const #

go:generate stringer -type=RelocType

const R_LOONG64_ADDR_LO

R_LOONG64_GOT_HI const #

R_LOONG64_GOT_HI and R_LOONG64_GOT_LO resolves a GOT-relative instruction sequence, usually an pcalau12i followed by another ld or addi instruction.

const R_LOONG64_GOT_HI

R_LOONG64_GOT_LO const #

go:generate stringer -type=RelocType

const R_LOONG64_GOT_LO

R_LOONG64_SUB64 const #

64-bit in-place subtraction.

const R_LOONG64_SUB64

R_LOONG64_TLS_IE_HI const #

R_LOONG64_TLS_IE_HI and R_LOONG64_TLS_IE_LO relocates a pcalau12i, ld.d pair to compute the address of the GOT slot of the tls symbol.

const R_LOONG64_TLS_IE_HI

R_LOONG64_TLS_IE_LO const #

go:generate stringer -type=RelocType

const R_LOONG64_TLS_IE_LO

R_LOONG64_TLS_LE_HI const #

R_LOONG64_TLS_LE_HI resolves to the high 20 bits of a TLS address (offset from thread pointer), by encoding it into the instruction. R_LOONG64_TLS_LE_LO resolves to the low 12 bits of a TLS address (offset from thread pointer), by encoding it into the instruction.

const R_LOONG64_TLS_LE_HI

R_LOONG64_TLS_LE_LO const #

go:generate stringer -type=RelocType

const R_LOONG64_TLS_LE_LO

R_METHODOFF const #

R_METHODOFF resolves to a 32-bit offset from the beginning of the section holding the data being relocated to the referenced symbol. It is a variant of R_ADDROFF used when linking from the uncommonType of a *rtype, and may be set to zero by the linker if it determines the method text is unreachable by the linked program.

const R_METHODOFF

R_PCREL const #

go:generate stringer -type=RelocType

const R_PCREL

R_PCRELDBL const #

R_PCRELDBL relocates s390x 2-byte aligned PC-relative addresses. TODO(mundaym): remove once variants can be serialized - see issue 14218.

const R_PCRELDBL

R_PEIMAGEOFF const #

R_PEIMAGEOFF resolves to a 32-bit offset from the start address of where the executable file is mapped in memory.

const R_PEIMAGEOFF

R_PLT0 const #

go:generate stringer -type=RelocType

const R_PLT0

R_PLT1 const #

go:generate stringer -type=RelocType

const R_PLT1

R_PLT2 const #

go:generate stringer -type=RelocType

const R_PLT2

R_POWER_TLS const #

R_POWER_TLS marks an X-form instruction such as "ADD R3,R13,R4" as completing a sequence of GOT-relative relocations to compute a TLS address. This can be used by the system linker to rewrite the GOT-relative TLS relocation into a simpler thread-pointer relative relocation. See table 3.26 and 3.28 in the ppc64 elfv2 1.4 ABI on this transformation. Likewise, the second argument (usually called RB in X-form instructions) is assumed to be R13.

const R_POWER_TLS

R_POWER_TLS_IE const #

R_POWER_TLS_IE is used to implement the "initial exec" model for tls access. It relocates a D-form, DS-form instruction sequence like R_ADDRPOWER_DS. It inserts to the offset of GOT slot for the thread-local symbol from the TOC (the GOT slot is filled by the dynamic linker with the offset of the thread-local symbol from the thread pointer (R13)).

const R_POWER_TLS_IE

R_POWER_TLS_IE_PCREL34 const #

R_POWER_TLS_IE_PCREL34 is similar to R_POWER_TLS_IE, but marks a single MOVD which has been assembled as a single prefixed load doubleword without using the TOC.

const R_POWER_TLS_IE_PCREL34

R_POWER_TLS_LE const #

R_POWER_TLS_LE is used to implement the "local exec" model for tls access. It resolves to the offset of the thread-local symbol from the thread pointer (R13) and is split against a pair of instructions to support a 32 bit displacement.

const R_POWER_TLS_LE

R_POWER_TLS_LE_TPREL34 const #

R_POWER_TLS_LE_TPREL34 is similar to R_POWER_TLS_LE, but computes an offset from the thread pointer in one prefixed instruction.

const R_POWER_TLS_LE_TPREL34

R_POWER_TOC const #

go:generate stringer -type=RelocType

const R_POWER_TOC

R_RISCV_BRANCH const #

R_RISCV_BRANCH resolves a 12-bit PC-relative branch offset.

const R_RISCV_BRANCH

R_RISCV_CALL const #

R_RISCV_CALL resolves a 32 bit PC-relative address for an AUIPC + JALR instruction pair.

const R_RISCV_CALL

R_RISCV_GOT_HI20 const #

R_RISCV_GOT_HI20 resolves the high 20 bits of a 32-bit PC-relative GOT address.

const R_RISCV_GOT_HI20

R_RISCV_JAL const #

R_RISCV_JAL resolves a 20 bit offset for a J-type instruction.

const R_RISCV_JAL

R_RISCV_JAL_TRAMP const #

R_RISCV_JAL_TRAMP is the same as R_RISCV_JAL but denotes the use of a trampoline, which we may be able to avoid during relocation. These are only used by the linker and are not emitted by the compiler or assembler.

const R_RISCV_JAL_TRAMP

R_RISCV_PCREL_HI20 const #

R_RISCV_PCREL_HI20 resolves the high 20 bits of a 32-bit PC-relative address.

const R_RISCV_PCREL_HI20

R_RISCV_PCREL_ITYPE const #

R_RISCV_PCREL_ITYPE resolves a 32 bit PC-relative address for an AUIPC + I-type instruction pair.

const R_RISCV_PCREL_ITYPE

R_RISCV_PCREL_LO12_I const #

R_RISCV_PCREL_LO12_I resolves the low 12 bits of a 32-bit PC-relative address using an I-type instruction.

const R_RISCV_PCREL_LO12_I

R_RISCV_PCREL_LO12_S const #

R_RISCV_PCREL_LO12_S resolves the low 12 bits of a 32-bit PC-relative address using an S-type instruction.

const R_RISCV_PCREL_LO12_S

R_RISCV_PCREL_STYPE const #

R_RISCV_PCREL_STYPE resolves a 32 bit PC-relative address for an AUIPC + S-type instruction pair.

const R_RISCV_PCREL_STYPE

R_RISCV_RVC_BRANCH const #

R_RISCV_RVC_BRANCH resolves an 8-bit PC-relative offset for a CB-type instruction.

const R_RISCV_RVC_BRANCH

R_RISCV_RVC_JUMP const #

R_RISCV_RVC_JUMP resolves an 11-bit PC-relative offset for a CJ-type instruction.

const R_RISCV_RVC_JUMP

R_RISCV_TLS_IE const #

R_RISCV_TLS_IE resolves a 32 bit TLS initial-exec address for an AUIPC + I-type instruction pair.

const R_RISCV_TLS_IE

R_RISCV_TLS_LE const #

R_RISCV_TLS_LE resolves a 32 bit TLS local-exec address for a LUI + I-type instruction sequence.

const R_RISCV_TLS_LE

R_SIZE const #

go:generate stringer -type=RelocType

const R_SIZE

R_TLS_IE const #

R_TLS_IE, used 386, amd64, and ARM resolves to the PC-relative offset to a GOT slot containing the offset from the thread-local symbol from the thread local base and is used to implemented the "initial exec" model for tls access (r.Sym is not set on intel platforms but is set to a TLS symbol -- runtime.tlsg -- in the linker when externally linking).

const R_TLS_IE

R_TLS_LE const #

R_TLS_LE, used on 386, amd64, and ARM, resolves to the offset of the thread-local symbol from the thread local base and is used to implement the "local exec" model for tls access (r.Sym is not set on intel platforms but is set to a TLS symbol -- runtime.tlsg -- in the linker when externally linking).

const R_TLS_LE

R_USEFIELD const #

go:generate stringer -type=RelocType

const R_USEFIELD

R_USEIFACE const #

R_USEIFACE marks a type is converted to an interface in the function this relocation is applied to. The target is a type descriptor or an itab (in the latter case it refers to the concrete type contained in the itab). This is a marker relocation (0-sized), for the linker's reachabililty analysis.

const R_USEIFACE

R_USEIFACEMETHOD const #

R_USEIFACEMETHOD marks an interface method that is used in the function this relocation is applied to. The target is an interface type descriptor. The addend is the offset of the method in the type descriptor. This is a marker relocation (0-sized), for the linker's reachabililty analysis.

const R_USEIFACEMETHOD

R_USENAMEDMETHOD const #

R_USENAMEDMETHOD marks that methods with a specific name must not be eliminated. The target is a symbol containing the name of a method called via a generic interface or looked up via MethodByName("F").

const R_USENAMEDMETHOD

R_USETYPE const #

R_USETYPE resolves to an *rtype, but no relocation is created. The linker uses this as a signal that the pointed-to type information should be linked into the final binary, even if there are no other direct references. (This is used for types reachable by reflection.)

const R_USETYPE

R_WASMIMPORT const #

R_WASMIMPORT resolves to the index of the WebAssembly function import.

const R_WASMIMPORT

R_WEAK const #

R_WEAK marks the relocation as a weak reference. A weak relocation does not make the symbol it refers to reachable, and is only honored by the linker if the symbol is in some other way reachable.

const R_WEAK = *ast.BinaryExpr

R_WEAKADDR const #

go:generate stringer -type=RelocType

const R_WEAKADDR = *ast.BinaryExpr

R_WEAKADDROFF const #

go:generate stringer -type=RelocType

const R_WEAKADDROFF = *ast.BinaryExpr

R_XCOFFREF const #

R_XCOFFREF (only used on aix/ppc64) prevents garbage collection by ld of a symbol. This isn't a real relocation, it can be placed in anywhere in a symbol and target any symbols.

const R_XCOFFREF

SBSS const #

Statically data that is initially all 0s

const SBSS

SCOVERAGE_AUXVAR const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SCOVERAGE_AUXVAR

SCOVERAGE_COUNTER const #

Coverage instrumentation counter, aux variable for cmd/cover

const SCOVERAGE_COUNTER

SDATA const #

Static data

const SDATA

SDATAFIPS const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDATAFIPS

SDWARFABSFCN const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFABSFCN

SDWARFCONST const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFCONST

SDWARFCUINFO const #

Debugging data

const SDWARFCUINFO

SDWARFFCN const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFFCN

SDWARFLINES const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFLINES

SDWARFLOC const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFLOC

SDWARFRANGE const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFRANGE

SDWARFTYPE const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFTYPE

SDWARFVAR const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SDWARFVAR

SLIBFUZZER_8BIT_COUNTER const #

Coverage instrumentation counter for libfuzzer.

const SLIBFUZZER_8BIT_COUNTER

SNOPTRBSS const #

Statically data that is initially all 0s and does not contain pointers

const SNOPTRBSS

SNOPTRDATA const #

Static data that does not contain any pointers

const SNOPTRDATA

SNOPTRDATAFIPS const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SNOPTRDATAFIPS

SRODATA const #

Read only static data

const SRODATA

SRODATAFIPS const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SRODATAFIPS

SSEHUNWINDINFO const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const SSEHUNWINDINFO

STEXT const #

Executable instructions

const STEXT

STEXTFIPS const #

Defined SymKind values. These are used to index into cmd/link/internal/sym/AbiSymKindToSymKind TODO(rsc): Give idiomatic Go names. go:generate stringer -type=SymKind

const STEXTFIPS

STLSBSS const #

Thread-local data that is initially all 0s

const STLSBSS

Sxxx const #

An otherwise invalid zero value for the type

const Sxxx SymKind = iota

_RelocType_index var #

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

_RelocType_name const #

const _RelocType_name = "R_ADDRR_ADDRPOWERR_ADDRARM64R_ADDRMIPSR_ADDROFFR_SIZER_CALLR_CALLARMR_CALLARM64R_CALLINDR_CALLPOWERR_CALLMIPSR_CONSTR_PCRELR_TLS_LER_TLS_IER_GOTOFFR_PLT0R_PLT1R_PLT2R_USEFIELDR_USETYPER_USEIFACER_USEIFACEMETHODR_USENAMEDMETHODR_METHODOFFR_KEEPR_POWER_TOCR_GOTPCRELR_JMPMIPSR_DWARFSECREFR_DWARFFILEREFR_ARM64_TLS_LER_ARM64_TLS_IER_ARM64_GOTPCRELR_ARM64_GOTR_ARM64_PCRELR_ARM64_PCREL_LDST8R_ARM64_PCREL_LDST16R_ARM64_PCREL_LDST32R_ARM64_PCREL_LDST64R_ARM64_LDST8R_ARM64_LDST16R_ARM64_LDST32R_ARM64_LDST64R_ARM64_LDST128R_POWER_TLS_LER_POWER_TLS_IER_POWER_TLSR_POWER_TLS_IE_PCREL34R_POWER_TLS_LE_TPREL34R_ADDRPOWER_DSR_ADDRPOWER_GOTR_ADDRPOWER_GOT_PCREL34R_ADDRPOWER_PCRELR_ADDRPOWER_TOCRELR_ADDRPOWER_TOCREL_DSR_ADDRPOWER_D34R_ADDRPOWER_PCREL34R_RISCV_JALR_RISCV_JAL_TRAMPR_RISCV_CALLR_RISCV_PCREL_ITYPER_RISCV_PCREL_STYPER_RISCV_TLS_IER_RISCV_TLS_LER_RISCV_GOT_HI20R_RISCV_PCREL_HI20R_RISCV_PCREL_LO12_IR_RISCV_PCREL_LO12_SR_RISCV_BRANCHR_RISCV_RVC_BRANCHR_RISCV_RVC_JUMPR_PCRELDBLR_LOONG64_ADDR_HIR_LOONG64_ADDR_LOR_LOONG64_TLS_LE_HIR_LOONG64_TLS_LE_LOR_CALLLOONG64R_LOONG64_TLS_IE_HIR_LOONG64_TLS_IE_LOR_LOONG64_GOT_HIR_LOONG64_GOT_LOR_LOONG64_ADD64R_LOONG64_SUB64R_JMP16LOONG64R_JMP21LOONG64R_JMPLOONG64R_ADDRMIPSUR_ADDRMIPSTLSR_ADDRCUOFFR_WASMIMPORTR_XCOFFREFR_PEIMAGEOFFR_INITORDER"

_SymKind_index var #

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

_SymKind_name const #

const _SymKind_name = "SxxxSTEXTSTEXTFIPSSRODATASRODATAFIPSSNOPTRDATASNOPTRDATAFIPSSDATASDATAFIPSSBSSSNOPTRBSSSTLSBSSSDWARFCUINFOSDWARFCONSTSDWARFFCNSDWARFABSFCNSDWARFTYPESDWARFVARSDWARFRANGESDWARFLOCSDWARFLINESSLIBFUZZER_8BIT_COUNTERSCOVERAGE_COUNTERSCOVERAGE_AUXVARSSEHUNWINDINFO"

allowAsmABIPkgs var #

var allowAsmABIPkgs = []string{...}

buildID var #

var buildID string

debugHelpHeader const #

const debugHelpHeader = `usage: -d arg[,arg]* and arg is [=]

 is one of:

`

extraNoInstrumentPkgs var #

extraNoInstrumentPkgs is the set of packages in addition to runtimePkgs that should have NoInstrument set.

var extraNoInstrumentPkgs = []string{...}

funcIDs var #

var funcIDs = map[string]abi.FuncID{...}

noRaceFuncPkgs var #

var noRaceFuncPkgs = []string{...}

pkgSpecialsOnce var #

var pkgSpecialsOnce = *ast.CallExpr

runtimePkgs var #

var runtimePkgs = []string{...}

Type Aliases

DebugSSA type #

A DebugSSA function is called to set a -d ssa/... option. If nil, those options are reported as invalid options. If DebugSSA returns a non-empty string, that text is reported as a compiler error. If phase is "help", it should print usage information and terminate the process.

type DebugSSA func(phase string, flag string, val int, valString string) string

HeadType type #

HeadType is the executable header type.

type HeadType uint8

RelocType type #

type RelocType int16

SymKind type #

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

type SymKind uint8

count type #

count is a flag.Value that is like a flag.Bool and a flag.Int. If used as -name, it increments the count, but -name=x sets the count. Used for verbose flag -v.

type count int

fn1 type #

type fn1 func(string)

Structs

DebugFlag struct #

type DebugFlag struct {
tab map[string]debugField
concurrentOk *bool
debugSSA DebugSSA
}

PkgSpecial struct #

PkgSpecial indicates special build properties of a given runtime-related package.

type PkgSpecial struct {
Runtime bool
NoInstrument bool
NoRaceFunc bool
AllowAsmABI bool
}

debugField struct #

type debugField struct {
name string
help string
concurrentOk bool
val interface{}
}

versionFlag struct #

type versionFlag struct {

}

Functions

AbsFile function #

AbsFile returns the absolute filename for file in the given directory, as rewritten by the rewrites argument. For unrewritten paths, AbsFile rewrites a leading $GOROOT prefix to the literal "$GOROOT". If the resulting path is the empty string, the result is "??". The rewrites argument is a ;-separated list of rewrites. Each rewrite is of the form "prefix" or "prefix=>replace", where prefix must match a leading sequence of path elements and is either removed entirely or replaced by the replacement.

func AbsFile(dir string, file string, rewrites string) string

AddVersionFlag function #

func AddVersionFlag()

ApplyRewrites function #

ApplyRewrites returns the filename for file in the given directory, as rewritten by the rewrites argument. The rewrites argument is a ;-separated list of rewrites. Each rewrite is of the form "prefix" or "prefix=>replace", where prefix must match a leading sequence of path elements and is either removed entirely or replaced by the replacement.

func ApplyRewrites(file string, rewrites string) (string, bool)

DecodeArg function #

DecodeArg decodes an argument. This function is public for testing with the parallel encoder.

func DecodeArg(arg string) string

Flagcount function #

func Flagcount(name string, usage string, val *int)

Flagfn1 function #

func Flagfn1(name string, usage string, f func(string))

Flagparse function #

func Flagparse(usage func())

Flagprint function #

func Flagprint(w io.Writer)

Get method #

func (versionFlag) Get() interface{}

Get method #

func (c *count) Get() interface{}

GetFuncID function #

Get the function ID for the named function in the named file. The function should be package-qualified.

func GetFuncID(name string, isWrapper bool) abi.FuncID

HeaderString function #

HeaderString returns the toolchain configuration string written in Go object headers. This string ensures we don't attempt to import or link object files that are incompatible with each other. This string always starts with "go object ".

func HeaderString() string

IsBoolFlag method #

func (versionFlag) IsBoolFlag() bool

IsBoolFlag method #

func (c *count) IsBoolFlag() bool

IsCountFlag method #

func (c *count) IsCountFlag() bool

IsDATA method #

IsDATA reports whether t is one of the DATA kinds (SDATA or SDATAFIPS, excluding NOPTRDATA, RODATA, BSS, and so on).

func (t SymKind) IsDATA() bool

IsDirectCall method #

IsDirectCall reports whether r is a relocation for a direct call. A direct call is a CALL instruction that takes the target address as an immediate. The address is embedded into the instruction(s), possibly with limited width. An indirect call is a CALL instruction that takes the target address in register or memory.

func (r RelocType) IsDirectCall() bool

IsDirectCallOrJump method #

IsDirectCallOrJump reports whether r is a relocation for a direct call or a direct jump.

func (r RelocType) IsDirectCallOrJump() bool

IsDirectJump method #

IsDirectJump reports whether r is a relocation for a direct jump. A direct jump is a JMP instruction that takes the target address as an immediate. The address is embedded into the instruction, possibly with limited width. An indirect jump is a JMP instruction that takes the target address in register or memory.

func (r RelocType) IsDirectJump() bool

IsFIPS method #

IsFIPS reports whether t is one fo the FIPS kinds.

func (t SymKind) IsFIPS() bool

IsText method #

IsText reports whether t is one of the text kinds.

func (t SymKind) IsText() bool

LookupPkgSpecial function #

LookupPkgSpecial returns special build properties for the given package path.

func LookupPkgSpecial(pkgPath string) PkgSpecial

NewDebugFlag function #

NewDebugFlag constructs a DebugFlag for the fields of debug, which must be a pointer to a struct. Each field of *debug is a different value, named for the lower-case of the field name. Each field must be an int or string and must have a `help` struct tag. There may be an "Any bool" field, which will be set if any debug flags are set. The returned flag takes a comma-separated list of settings. Each setting is name=value; for ints, name is short for name=1. If debugSSA is non-nil, any debug flags of the form ssa/... will be passed to debugSSA for processing.

func NewDebugFlag(debug interface{}, debugSSA DebugSSA) *DebugFlag

PathToPrefix function #

PathToPrefix converts raw string to the prefix that will be used in the symbol table. All control characters, space, '%' and '"', as well as non-7-bit clean bytes turn into %xx. The period needs escaping only in the last segment of the path, and it makes for happier users if we escape that as little as possible.

func PathToPrefix(s string) string

PrefixToPath function #

PrefixToPath is the inverse of PathToPrefix, replacing escape sequences with the original character.

func PrefixToPath(s string) (string, error)

Set method #

func (f *DebugFlag) Set(debugstr string) error

Set method #

func (f fn1) Set(s string) error

Set method #

func (h *HeadType) Set(s string) error

Set method #

func (versionFlag) Set(s string) error

Set method #

func (c *count) Set(s string) error

StackNosplit function #

func StackNosplit(race bool) int

String method #

func (c *count) String() string

String method #

func (f fn1) String() string

String method #

func (i RelocType) String() string

String method #

func (h HeadType) String() string

String method #

func (f *DebugFlag) String() string

String method #

func (i SymKind) String() string

String method #

func (versionFlag) String() string

WorkingDir function #

WorkingDir returns the current working directory (or "/???" if the directory cannot be identified), with "/" as separator.

func WorkingDir() string

_ function #

func _()

_ function #

func _()

applyRewrite function #

applyRewrite applies the rewrite to the path, returning the rewritten path and a boolean indicating whether the rewrite applied at all.

func applyRewrite(path string, rewrite string) (string, bool)

expandArgs function #

expandArgs expands "response files" arguments in the provided slice. A "response file" argument starts with '@' and the rest of that argument is a filename with CR-or-CRLF-separated arguments. Each argument in the named files can also contain response file arguments. See Issue 18468. The returned slice 'out' aliases 'in' iff the input did not contain any response file arguments. TODO: handle relative paths of recursive expansions in different directories? Is there a spec for this? Are relative paths allowed?

func expandArgs(in []string) (out []string)

hasPathPrefix function #

Does s have t as a path prefix? That is, does s == t or does s begin with t followed by a slash? For portability, we allow ASCII case folding, so that hasPathPrefix("a/b/c", "A/B") is true. Similarly, we allow slash folding, so that hasPathPrefix("a/b/c", "a\\b") is true. We do not allow full Unicode case folding, for fear of causing more confusion or harm than good. (For an example of the kinds of things that can go wrong, see http://article.gmane.org/gmane.linux.kernel/1853266.)

func hasPathPrefix(s string, t string) bool

stackGuardMultiplier function #

stackGuardMultiplier returns a multiplier to apply to the default stack guard size. Larger multipliers are used for non-optimized builds that have larger stack frames or for specific targets.

func stackGuardMultiplier(race bool) int

Generated with Arrow