From af817890aa7b628234075a6cb01a3a435fb8317d Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 17 Jun 2015 17:25:35 -0700 Subject: [PATCH] go/gccgoimporter: fix tests for Plan9 This is a backport of https://go-review.googlesource.com/#/c/11194/. Change-Id: I2f8a8efec77a29258c85f5a1b11cd9deb81853d0 Reviewed-on: https://go-review.googlesource.com/11210 Reviewed-by: Ian Lance Taylor --- go/gccgoimporter/importer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/go/gccgoimporter/importer.go b/go/gccgoimporter/importer.go index 59576cad29d0bc..ac484af9be38fe 100644 --- a/go/gccgoimporter/importer.go +++ b/go/gccgoimporter/importer.go @@ -91,6 +91,12 @@ func openExportFile(fpath string) (reader io.ReadSeeker, closer io.Closer, err e if err != nil { return } + // reset to offset 0 - needed on Plan 9 (see issue #11265) + // TODO: remove once issue #11265 has been resolved. + _, err = f.Seek(0, 0) + if err != nil { + return + } var elfreader io.ReaderAt switch string(magic[:]) {