github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/staticdata/data.go (about) 1 // Copyright 2009 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 staticdata 6 7 import ( 8 "github.com/shogo82148/std/cmd/compile/internal/ir" 9 "github.com/shogo82148/std/cmd/internal/obj" 10 "github.com/shogo82148/std/cmd/internal/src" 11 ) 12 13 // InitAddrOffset writes the static name symbol lsym to n, it does not modify n. 14 // It's the caller responsibility to make sure lsym is from ONAME/PEXTERN node. 15 func InitAddrOffset(n *ir.Name, noff int64, lsym *obj.LSym, off int64) 16 17 // InitAddr is InitAddrOffset, with offset fixed to 0. 18 func InitAddr(n *ir.Name, noff int64, lsym *obj.LSym) 19 20 // InitSlice writes a static slice symbol {lsym, lencap, lencap} to n+noff, it does not modify n. 21 // It's the caller responsibility to make sure lsym is from ONAME node. 22 func InitSlice(n *ir.Name, noff int64, lsym *obj.LSym, lencap int64) 23 24 func InitSliceBytes(nam *ir.Name, off int64, s string) 25 26 // StringSym returns a symbol containing the string s. 27 // The symbol contains the string data, not a string header. 28 func StringSym(pos src.XPos, s string) (data *obj.LSym) 29 30 // StringSymNoCommon is like StringSym, but produces a symbol that is not content- 31 // addressable. This symbol is not supposed to appear in the final binary, it is 32 // only used to pass string arguments to the linker like R_USENAMEDMETHOD does. 33 func StringSymNoCommon(s string) (data *obj.LSym) 34 35 // FuncLinksym returns n·f, the function value symbol for n. 36 func FuncLinksym(n *ir.Name) *obj.LSym 37 38 func GlobalLinksym(n *ir.Name) *obj.LSym 39 40 func WriteFuncSyms() 41 42 // InitConst writes the static literal c to n. 43 // Neither n nor c is modified. 44 func InitConst(n *ir.Name, noff int64, c ir.Node, wid int)