diff options
Diffstat (limited to 'src/cmd/internal/obj/data.go')
-rw-r--r-- | src/cmd/internal/obj/data.go | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/cmd/internal/obj/data.go b/src/cmd/internal/obj/data.go index ce0dd09a4f..23d1809e0c 100644 --- a/src/cmd/internal/obj/data.go +++ b/src/cmd/internal/obj/data.go @@ -117,7 +117,9 @@ func (s *LSym) WriteInt(ctxt *Link, off int64, siz int, i int64) { } } -func (s *LSym) writeAddr(ctxt *Link, off int64, siz int, rsym *LSym, roff int64, rtype objabi.RelocType) { +// WriteAddr writes an address of size siz into s at offset off. +// rsym and roff specify the relocation for the address. +func (s *LSym) WriteAddr(ctxt *Link, off int64, siz int, rsym *LSym, roff int64) { // Allow 4-byte addresses for DWARF. if siz != ctxt.Arch.PtrSize && siz != 4 { ctxt.Diag("WriteAddr: bad address size %d in %s", siz, s.Name) @@ -130,24 +132,10 @@ func (s *LSym) writeAddr(ctxt *Link, off int64, siz int, rsym *LSym, roff int64, } r.Siz = uint8(siz) r.Sym = rsym - r.Type = rtype + r.Type = objabi.R_ADDR r.Add = roff } -// WriteAddr writes an address of size siz into s at offset off. -// rsym and roff specify the relocation for the address. -func (s *LSym) WriteAddr(ctxt *Link, off int64, siz int, rsym *LSym, roff int64) { - s.writeAddr(ctxt, off, siz, rsym, roff, objabi.R_ADDR) -} - -// WriteCURelativeAddr writes a pointer-sized address into s at offset off. -// rsym and roff specify the relocation for the address which will be -// resolved by the linker to an offset from the DW_AT_low_pc attribute of -// the DWARF Compile Unit of rsym. -func (s *LSym) WriteCURelativeAddr(ctxt *Link, off int64, rsym *LSym, roff int64) { - s.writeAddr(ctxt, off, ctxt.Arch.PtrSize, rsym, roff, objabi.R_ADDRCUOFF) -} - // WriteOff writes a 4 byte offset to rsym+roff into s at offset off. // After linking the 4 bytes stored at s+off will be // rsym+roff-(start of section that s is in). |