github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/link/internal/sym/compilation_unit.go (about)

     1  // Copyright 2019 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package sym
     6  
     7  import "github.com/shogo82148/std/cmd/internal/dwarf"
     8  
     9  // LoaderSym holds a loader.Sym value. We can't refer to this
    10  // type from the sym package since loader imports sym.
    11  type LoaderSym uint32
    12  
    13  // A CompilationUnit represents a set of source files that are compiled
    14  // together. Since all Go sources in a Go package are compiled together,
    15  // there's one CompilationUnit per package that represents all Go sources in
    16  // that package, plus one for each assembly file.
    17  //
    18  // Equivalently, there's one CompilationUnit per object file in each Library
    19  // loaded by the linker.
    20  //
    21  // These are used for both DWARF and pclntab generation.
    22  type CompilationUnit struct {
    23  	Lib       *Library
    24  	PclnIndex int
    25  	PCs       []dwarf.Range
    26  	DWInfo    *dwarf.DWDie
    27  	FileTable []string
    28  
    29  	Consts    LoaderSym
    30  	FuncDIEs  []LoaderSym
    31  	VarDIEs   []LoaderSym
    32  	AbsFnDIEs []LoaderSym
    33  	RangeSyms []LoaderSym
    34  	Textp     []LoaderSym
    35  }