diff options
Diffstat (limited to 'src/cmd/internal/objfile')
| -rw-r--r-- | src/cmd/internal/objfile/goobj.go | 4 | ||||
| -rw-r--r-- | src/cmd/internal/objfile/xcoff.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/internal/objfile/goobj.go b/src/cmd/internal/objfile/goobj.go index c428e29c9b..7d564a2661 100644 --- a/src/cmd/internal/objfile/goobj.go +++ b/src/cmd/internal/objfile/goobj.go @@ -240,7 +240,7 @@ func (f *goobjFile) PCToLine(pc uint64) (string, int, *gosym.Func) { // We don't need the data for non-hashed symbols, yet. panic("not supported") } - i := uint32(s.SymIdx + uint32(r.NSym()+r.NHashed64def())) + i := s.SymIdx + uint32(r.NSym()+r.NHashed64def()) return r.BytesAt(r.DataOff(i), r.DataSize(i)) } @@ -325,7 +325,7 @@ func readvarint(p *[]byte) uint32 { // We treat the whole object file as the text section. func (f *goobjFile) text() (textStart uint64, text []byte, err error) { text = make([]byte, f.goobj.Size) - _, err = f.f.ReadAt(text, int64(f.goobj.Offset)) + _, err = f.f.ReadAt(text, f.goobj.Offset) return } diff --git a/src/cmd/internal/objfile/xcoff.go b/src/cmd/internal/objfile/xcoff.go index d6df4db8f0..24f42760c9 100644 --- a/src/cmd/internal/objfile/xcoff.go +++ b/src/cmd/internal/objfile/xcoff.go @@ -44,7 +44,7 @@ func (f *xcoffFile) symbols() ([]Sym, error) { case N_DEBUG: sym.Code = '?' default: - if s.SectionNumber < 0 || len(f.xcoff.Sections) < int(s.SectionNumber) { + if s.SectionNumber < 0 || len(f.xcoff.Sections) < s.SectionNumber { return nil, fmt.Errorf("invalid section number in symbol table") } sect := f.xcoff.Sections[s.SectionNumber-1] @@ -116,7 +116,7 @@ func findXCOFFSymbol(f *xcoff.File, name string) (*xcoff.Symbol, error) { if s.SectionNumber <= 0 { return nil, fmt.Errorf("symbol %s: invalid section number %d", name, s.SectionNumber) } - if len(f.Sections) < int(s.SectionNumber) { + if len(f.Sections) < s.SectionNumber { return nil, fmt.Errorf("symbol %s: section number %d is larger than max %d", name, s.SectionNumber, len(f.Sections)) } return s, nil |
