go/src/cmd/link/internal/loadpe/ldpe.go

const IMAGE_SYM_UNDEFINED

const IMAGE_SYM_ABSOLUTE

const IMAGE_SYM_DEBUG

const IMAGE_SYM_TYPE_NULL

const IMAGE_SYM_TYPE_VOID

const IMAGE_SYM_TYPE_CHAR

const IMAGE_SYM_TYPE_SHORT

const IMAGE_SYM_TYPE_INT

const IMAGE_SYM_TYPE_LONG

const IMAGE_SYM_TYPE_FLOAT

const IMAGE_SYM_TYPE_DOUBLE

const IMAGE_SYM_TYPE_STRUCT

const IMAGE_SYM_TYPE_UNION

const IMAGE_SYM_TYPE_ENUM

const IMAGE_SYM_TYPE_MOE

const IMAGE_SYM_TYPE_BYTE

const IMAGE_SYM_TYPE_WORD

const IMAGE_SYM_TYPE_UINT

const IMAGE_SYM_TYPE_DWORD

const IMAGE_SYM_TYPE_PCODE

const IMAGE_SYM_DTYPE_NULL

const IMAGE_SYM_DTYPE_POINTER

const IMAGE_SYM_DTYPE_FUNCTION

const IMAGE_SYM_DTYPE_ARRAY

const IMAGE_SYM_CLASS_END_OF_FUNCTION

const IMAGE_SYM_CLASS_NULL

const IMAGE_SYM_CLASS_AUTOMATIC

const IMAGE_SYM_CLASS_EXTERNAL

const IMAGE_SYM_CLASS_STATIC

const IMAGE_SYM_CLASS_REGISTER

const IMAGE_SYM_CLASS_EXTERNAL_DEF

const IMAGE_SYM_CLASS_LABEL

const IMAGE_SYM_CLASS_UNDEFINED_LABEL

const IMAGE_SYM_CLASS_MEMBER_OF_STRUCT

const IMAGE_SYM_CLASS_ARGUMENT

const IMAGE_SYM_CLASS_STRUCT_TAG

const IMAGE_SYM_CLASS_MEMBER_OF_UNION

const IMAGE_SYM_CLASS_UNION_TAG

const IMAGE_SYM_CLASS_TYPE_DEFINITION

const IMAGE_SYM_CLASS_UNDEFINED_STATIC

const IMAGE_SYM_CLASS_ENUM_TAG

const IMAGE_SYM_CLASS_MEMBER_OF_ENUM

const IMAGE_SYM_CLASS_REGISTER_PARAM

const IMAGE_SYM_CLASS_BIT_FIELD

const IMAGE_SYM_CLASS_FAR_EXTERNAL

const IMAGE_SYM_CLASS_BLOCK

const IMAGE_SYM_CLASS_FUNCTION

const IMAGE_SYM_CLASS_END_OF_STRUCT

const IMAGE_SYM_CLASS_FILE

const IMAGE_SYM_CLASS_SECTION

const IMAGE_SYM_CLASS_WEAK_EXTERNAL

const IMAGE_SYM_CLASS_CLR_TOKEN

const IMAGE_REL_I386_ABSOLUTE

const IMAGE_REL_I386_DIR16

const IMAGE_REL_I386_REL16

const IMAGE_REL_I386_DIR32

const IMAGE_REL_I386_DIR32NB

const IMAGE_REL_I386_SEG12

const IMAGE_REL_I386_SECTION

const IMAGE_REL_I386_SECREL

const IMAGE_REL_I386_TOKEN

const IMAGE_REL_I386_SECREL7

const IMAGE_REL_I386_REL32

const IMAGE_REL_AMD64_ABSOLUTE

const IMAGE_REL_AMD64_ADDR64

const IMAGE_REL_AMD64_ADDR32

const IMAGE_REL_AMD64_ADDR32NB

const IMAGE_REL_AMD64_REL32

const IMAGE_REL_AMD64_REL32_1

const IMAGE_REL_AMD64_REL32_2

const IMAGE_REL_AMD64_REL32_3

const IMAGE_REL_AMD64_REL32_4

const IMAGE_REL_AMD64_REL32_5

const IMAGE_REL_AMD64_SECTION

const IMAGE_REL_AMD64_SECREL

const IMAGE_REL_AMD64_SECREL7

const IMAGE_REL_AMD64_TOKEN

const IMAGE_REL_AMD64_SREL32

const IMAGE_REL_AMD64_PAIR

const IMAGE_REL_AMD64_SSPAN32

const IMAGE_REL_ARM_ABSOLUTE

const IMAGE_REL_ARM_ADDR32

const IMAGE_REL_ARM_ADDR32NB

const IMAGE_REL_ARM_BRANCH24

const IMAGE_REL_ARM_BRANCH11

const IMAGE_REL_ARM_SECTION

const IMAGE_REL_ARM_SECREL

const IMAGE_REL_ARM_MOV32

const IMAGE_REL_THUMB_MOV32

const IMAGE_REL_THUMB_BRANCH20

const IMAGE_REL_THUMB_BRANCH24

const IMAGE_REL_THUMB_BLX23

const IMAGE_REL_ARM_PAIR

const IMAGE_REL_ARM64_ABSOLUTE

const IMAGE_REL_ARM64_ADDR32

const IMAGE_REL_ARM64_ADDR32NB

const IMAGE_REL_ARM64_BRANCH26

const IMAGE_REL_ARM64_PAGEBASE_REL21

const IMAGE_REL_ARM64_REL21

const IMAGE_REL_ARM64_PAGEOFFSET_12A

const IMAGE_REL_ARM64_PAGEOFFSET_12L

const IMAGE_REL_ARM64_SECREL

const IMAGE_REL_ARM64_SECREL_LOW12A

const IMAGE_REL_ARM64_SECREL_HIGH12A

const IMAGE_REL_ARM64_SECREL_LOW12L

const IMAGE_REL_ARM64_TOKEN

const IMAGE_REL_ARM64_SECTION

const IMAGE_REL_ARM64_ADDR64

const IMAGE_REL_ARM64_BRANCH19

const IMAGE_REL_ARM64_BRANCH14

const IMAGE_REL_ARM64_REL32

const CreateImportStubPltToken

const RedirectToDynImportGotToken

type peBiobuf

func (f *peBiobuf) ReadAt(p []byte, off int64) (int, error) {}

// makeUpdater creates a loader.SymbolBuilder if one hasn't been created previously.
// We use this to lazily make SymbolBuilders as we don't always need a builder, and creating them for all symbols might be an error.
func makeUpdater(l *loader.Loader, bld *loader.SymbolBuilder, s loader.Sym) *loader.SymbolBuilder {}

type peImportSymsState

var importSymsState

func createImportSymsState(l *loader.Loader, arch *sys.Arch) {}

type peLoaderState

var comdatDefinitions

type Symbols

// Load loads the PE file pn from input.
// Symbols from the object file are created via the loader 'l'.
func Load(l *loader.Loader, arch *sys.Arch, localSymVersion int, input *bio.Reader, pkg string, length int64, pn string) (*Symbols, error) {}

// PostProcessImports works to resolve inconsistencies with DLL import
// symbols; it is needed when building with more "modern" C compilers
// with internal linkage.
//
// Background: DLL import symbols are data (SNOPTRDATA) symbols whose
// name is of the form "__imp_XXX", which contain a pointer/reference
// to symbol XXX. It's possible to have import symbols for both data
// symbols ("__imp__fmode") and text symbols ("__imp_CreateEventA").
// In some case import symbols are just references to some external
// thing, and in other cases we see actual definitions of import
// symbols when reading host objects.
//
// Previous versions of the linker would in most cases immediately
// "forward" import symbol references, e.g. treat a references to
// "__imp_XXX" a references to "XXX", however this doesn't work well
// with more modern compilers, where you can sometimes see import
// symbols that are defs (as opposed to external refs).
//
// The main actions taken below are to search for references to
// SDYNIMPORT symbols in host object text/data sections and flag the
// symbols for later fixup. When we see a reference to an import
// symbol __imp_XYZ where XYZ corresponds to some SDYNIMPORT symbol,
// we flag the symbol (via GOT setting) so that it can be redirected
// to XYZ later in windynrelocsym. When we see a direct reference to
// an SDYNIMPORT symbol XYZ, we also flag the symbol (via PLT setting)
// to indicated that the reference will need to be redirected to a
// stub.
func PostProcessImports() error {}

func issehsect(arch *sys.Arch, s *pe.Section) bool {}

func issect(s *pe.COFFSymbol) bool {}

func (state *peLoaderState) readpesym(pesym *pe.COFFSymbol) (*loader.SymbolBuilder, loader.Sym, error) {}

// preprocessSymbols walks the COFF symbols for the PE file we're
// reading and looks for cases where we have both a symbol definition
// for "XXX" and an "__imp_XXX" symbol, recording these cases in a map
// in the state struct. This information will be used in readpesym()
// above to give such symbols special treatment. This function also
// gathers information about COMDAT sections/symbols for later use
// in readpesym().
func (state *peLoaderState) preprocessSymbols() error {}

// LookupBaseFromImport examines the symbol "s" to see if it
// corresponds to an import symbol (name of the form "__imp_XYZ") and
// if so, it looks up the underlying target of the import symbol and
// returns it. An error is returned if the symbol is of the form
// "__imp_XYZ" but no XYZ can be found.
func LookupBaseFromImport(s loader.Sym, ldr *loader.Loader, arch *sys.Arch) (loader.Sym, error) {}