mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] cmd/link: clean up some fields
With the new index mapping , we can clean up some fields. Loader.max should always be equal to len(loader.objSyms) now. And for external symbols we now give its "local index" as its index in the payload array, so Relocs.extIdx is no longer useful. Delete those fields. Change-Id: If387ff9201ea0d347b954f651f5d4b4ae74937aa Reviewed-on: https://go-review.googlesource.com/c/go/+/218478 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org>
This commit is contained in:
parent
6cfd1bcada
commit
06e2339dfe
2 changed files with 37 additions and 40 deletions
|
|
@ -19,12 +19,12 @@ import (
|
|||
// do anything interesting with this symbol (such as look at its
|
||||
// data or relocations).
|
||||
func addDummyObjSym(t *testing.T, ldr *Loader, or *oReader, name string) Sym {
|
||||
idx := ldr.max + 1
|
||||
if _, ok := ldr.AddSym(name, 0, or, int(idx), false, sym.SRODATA); !ok {
|
||||
idx := len(ldr.objSyms)
|
||||
s, ok := ldr.AddSym(name, 0, or, idx, false, sym.SRODATA)
|
||||
if !ok {
|
||||
t.Errorf("AddrSym failed for '" + name + "'")
|
||||
}
|
||||
|
||||
return idx
|
||||
return s
|
||||
}
|
||||
|
||||
func TestAddMaterializedSymbol(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue