mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] cmd/internal/goobj2: remove "2"
Rename Sym2 -> Sym Reloc2 -> Reloc Aux2 -> Aux Also the Reader methods. Change-Id: I49f29e2d1cb480f5309e01d7a74b5e0897d826fb Reviewed-on: https://go-review.googlesource.com/c/go/+/227900 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
82f6d8eabb
commit
a1c29156ae
6 changed files with 114 additions and 114 deletions
|
|
@ -131,7 +131,7 @@ func (sb *SymbolBuilder) Relocs() Relocs {
|
|||
func (sb *SymbolBuilder) SetRelocs(rslice []Reloc) {
|
||||
n := len(rslice)
|
||||
if cap(sb.relocs) < n {
|
||||
sb.relocs = make([]goobj2.Reloc2, n)
|
||||
sb.relocs = make([]goobj2.Reloc, n)
|
||||
sb.reltypes = make([]objabi.RelocType, n)
|
||||
} else {
|
||||
sb.relocs = sb.relocs[:n]
|
||||
|
|
@ -144,7 +144,7 @@ func (sb *SymbolBuilder) SetRelocs(rslice []Reloc) {
|
|||
|
||||
// Add n relocations, return a handle to the relocations.
|
||||
func (sb *SymbolBuilder) AddRelocs(n int) Relocs {
|
||||
sb.relocs = append(sb.relocs, make([]goobj2.Reloc2, n)...)
|
||||
sb.relocs = append(sb.relocs, make([]goobj2.Reloc, n)...)
|
||||
sb.reltypes = append(sb.reltypes, make([]objabi.RelocType, n)...)
|
||||
return sb.l.Relocs(sb.symIdx)
|
||||
}
|
||||
|
|
@ -153,7 +153,7 @@ func (sb *SymbolBuilder) AddRelocs(n int) Relocs {
|
|||
// (to set other fields).
|
||||
func (sb *SymbolBuilder) AddRel(typ objabi.RelocType) (Reloc2, int) {
|
||||
j := len(sb.relocs)
|
||||
sb.relocs = append(sb.relocs, goobj2.Reloc2{})
|
||||
sb.relocs = append(sb.relocs, goobj2.Reloc{})
|
||||
sb.reltypes = append(sb.reltypes, typ)
|
||||
relocs := sb.Relocs()
|
||||
return relocs.At2(j), j
|
||||
|
|
@ -180,7 +180,7 @@ func (p *relocsByOff) Swap(i, j int) {
|
|||
func (sb *SymbolBuilder) AddReloc(r Reloc) uint32 {
|
||||
// Populate a goobj2.Reloc from external reloc record.
|
||||
rval := uint32(len(sb.relocs))
|
||||
var b goobj2.Reloc2
|
||||
var b goobj2.Reloc
|
||||
b.Set(r.Off, r.Size, 0, r.Add, goobj2.SymRef{PkgIdx: 0, SymIdx: uint32(r.Sym)})
|
||||
sb.relocs = append(sb.relocs, b)
|
||||
sb.reltypes = append(sb.reltypes, r.Type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue