github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/internal/obj/data.go (about) 1 // Derived from Inferno utils/6l/obj.c and utils/6l/span.c 2 // https://bitbucket.org/inferno-os/inferno-os/src/master/utils/6l/obj.c 3 // https://bitbucket.org/inferno-os/inferno-os/src/master/utils/6l/span.c 4 // 5 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. 6 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) 7 // Portions Copyright © 1997-1999 Vita Nuova Limited 8 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) 9 // Portions Copyright © 2004,2006 Bruce Ellis 10 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) 11 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others 12 // Portions Copyright © 2009 The Go Authors. All rights reserved. 13 // 14 // Permission is hereby granted, free of charge, to any person obtaining a copy 15 // of this software and associated documentation files (the "Software"), to deal 16 // in the Software without restriction, including without limitation the rights 17 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 // copies of the Software, and to permit persons to whom the Software is 19 // furnished to do so, subject to the following conditions: 20 // 21 // The above copyright notice and this permission notice shall be included in 22 // all copies or substantial portions of the Software. 23 // 24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 30 // THE SOFTWARE. 31 32 package obj 33 34 // Grow increases the length of s.P to lsiz. 35 func (s *LSym) Grow(lsiz int64) 36 37 // GrowCap increases the capacity of s.P to c. 38 func (s *LSym) GrowCap(c int64) 39 40 // WriteFloat32 writes f into s at offset off. 41 func (s *LSym) WriteFloat32(ctxt *Link, off int64, f float32) 42 43 // WriteFloat64 writes f into s at offset off. 44 func (s *LSym) WriteFloat64(ctxt *Link, off int64, f float64) 45 46 // WriteInt writes an integer i of size siz into s at offset off. 47 func (s *LSym) WriteInt(ctxt *Link, off int64, siz int, i int64) 48 49 // WriteAddr writes an address of size siz into s at offset off. 50 // rsym and roff specify the relocation for the address. 51 func (s *LSym) WriteAddr(ctxt *Link, off int64, siz int, rsym *LSym, roff int64) 52 53 // WriteWeakAddr writes an address of size siz into s at offset off. 54 // rsym and roff specify the relocation for the address. 55 // This is a weak reference. 56 func (s *LSym) WriteWeakAddr(ctxt *Link, off int64, siz int, rsym *LSym, roff int64) 57 58 // WriteCURelativeAddr writes a pointer-sized address into s at offset off. 59 // rsym and roff specify the relocation for the address which will be 60 // resolved by the linker to an offset from the DW_AT_low_pc attribute of 61 // the DWARF Compile Unit of rsym. 62 func (s *LSym) WriteCURelativeAddr(ctxt *Link, off int64, rsym *LSym, roff int64) 63 64 // WriteOff writes a 4 byte offset to rsym+roff into s at offset off. 65 // After linking the 4 bytes stored at s+off will be 66 // rsym+roff-(start of section that s is in). 67 func (s *LSym) WriteOff(ctxt *Link, off int64, rsym *LSym, roff int64) 68 69 // WriteWeakOff writes a weak 4 byte offset to rsym+roff into s at offset off. 70 // After linking the 4 bytes stored at s+off will be 71 // rsym+roff-(start of section that s is in). 72 func (s *LSym) WriteWeakOff(ctxt *Link, off int64, rsym *LSym, roff int64) 73 74 // WriteString writes a string of size siz into s at offset off. 75 func (s *LSym) WriteString(ctxt *Link, off int64, siz int, str string) 76 77 // WriteBytes writes a slice of bytes into s at offset off. 78 func (s *LSym) WriteBytes(ctxt *Link, off int64, b []byte) int64 79 80 func Addrel(s *LSym) *Reloc