diff options
| author | Cherry Zhang <cherryyz@google.com> | 2020-08-02 19:36:28 -0400 |
|---|---|---|
| committer | Cherry Zhang <cherryyz@google.com> | 2020-08-11 18:32:23 +0000 |
| commit | 27e3778793c4ae4e54d27185f6955bc5c180151b (patch) | |
| tree | 3dc501029a93af24d68a7eb42ce15d26720c91a5 /src/cmd/internal/objfile | |
| parent | 9559877543976f8e7b15ae02a7196c4f930fc371 (diff) | |
| download | go-27e3778793c4ae4e54d27185f6955bc5c180151b.tar.xz | |
[dev.link] cmd: remove "2", another round
Rename the goobj2 package to goobj.
Change-Id: Iff97b5575cbac45ac44de96b6bd9d555b9a4a12a
Reviewed-on: https://go-review.googlesource.com/c/go/+/246444
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/cmd/internal/objfile')
| -rw-r--r-- | src/cmd/internal/objfile/goobj.go | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/cmd/internal/objfile/goobj.go b/src/cmd/internal/objfile/goobj.go index 6bf9d3bf21..5708f5ee18 100644 --- a/src/cmd/internal/objfile/goobj.go +++ b/src/cmd/internal/objfile/goobj.go @@ -8,7 +8,7 @@ package objfile import ( "cmd/internal/archive" - "cmd/internal/goobj2" + "cmd/internal/goobj" "cmd/internal/objabi" "cmd/internal/sys" "debug/dwarf" @@ -22,7 +22,7 @@ import ( type goobjFile struct { goobj *archive.GoObj - r *goobj2.Reader + r *goobj.Reader f *os.File } @@ -44,7 +44,7 @@ L: if err != nil { return nil, err } - r := goobj2.NewReaderFromBytes(b, false) + r := goobj.NewReaderFromBytes(b, false) entries = append(entries, &Entry{ name: e.Name, raw: &goobjFile{e.Obj, r, f}, @@ -103,7 +103,7 @@ func (f *goobjFile) symbols() ([]Sym, error) { // Name of referenced indexed symbols. nrefName := r.NRefName() - refNames := make(map[goobj2.SymRef]string, nrefName) + refNames := make(map[goobj.SymRef]string, nrefName) for i := 0; i < nrefName; i++ { rn := r.RefName(i) refNames[rn.Sym()] = rn.Name(r) @@ -111,31 +111,31 @@ func (f *goobjFile) symbols() ([]Sym, error) { abiToVer := func(abi uint16) int { var ver int - if abi == goobj2.SymABIstatic { + if abi == goobj.SymABIstatic { // Static symbol ver = 1 } return ver } - resolveSymRef := func(s goobj2.SymRef) string { + resolveSymRef := func(s goobj.SymRef) string { var i uint32 switch p := s.PkgIdx; p { - case goobj2.PkgIdxInvalid: + case goobj.PkgIdxInvalid: if s.SymIdx != 0 { panic("bad sym ref") } return "" - case goobj2.PkgIdxHashed64: + case goobj.PkgIdxHashed64: i = s.SymIdx + uint32(r.NSym()) - case goobj2.PkgIdxHashed: + case goobj.PkgIdxHashed: i = s.SymIdx + uint32(r.NSym()+r.NHashed64def()) - case goobj2.PkgIdxNone: + case goobj.PkgIdxNone: i = s.SymIdx + uint32(r.NSym()+r.NHashed64def()+r.NHasheddef()) - case goobj2.PkgIdxBuiltin: - name, abi := goobj2.BuiltinName(int(s.SymIdx)) + case goobj.PkgIdxBuiltin: + name, abi := goobj.BuiltinName(int(s.SymIdx)) return goobjName(name, abi) - case goobj2.PkgIdxSelf: + case goobj.PkgIdxSelf: i = s.SymIdx default: return refNames[s] @@ -166,7 +166,7 @@ func (f *goobjFile) symbols() ([]Sym, error) { case objabi.SBSS, objabi.SNOPTRBSS, objabi.STLSBSS: code = 'B' } - if ver >= goobj2.SymABIstatic { + if ver >= goobj.SymABIstatic { code += 'a' - 'A' } @@ -248,10 +248,10 @@ func (f *goobjFile) PCToLine(pc uint64) (string, int, *gosym.Func) { auxs := r.Auxs(i) for j := range auxs { a := &auxs[j] - if a.Type() != goobj2.AuxFuncInfo { + if a.Type() != goobj.AuxFuncInfo { continue } - if a.Sym().PkgIdx != goobj2.PkgIdxSelf { + if a.Sym().PkgIdx != goobj.PkgIdxSelf { panic("funcinfo symbol not defined in current package") } isym = a.Sym().SymIdx @@ -260,7 +260,7 @@ func (f *goobjFile) PCToLine(pc uint64) (string, int, *gosym.Func) { continue } b := r.BytesAt(r.DataOff(isym), r.DataSize(isym)) - var info *goobj2.FuncInfo + var info *goobj.FuncInfo lengths := info.ReadFuncInfoLengths(b) off, end := info.ReadPcline(b) pcline := r.BytesAt(pcdataBase+off, int(end-off)) |
