)
var (
- flagiexport bool // if set, use indexed export data format
-
Debug_export int // if set, print debugging information about export data
)
// The linker also looks for the $$ marker - use char after $$ to distinguish format.
exportf(bout, "\n$$B\n") // indicate binary export format
off := bout.Offset()
- if flagiexport {
- iexport(bout.Writer)
- } else {
- export(bout.Writer, Debug_export != 0)
- }
+ iexport(bout.Writer)
size := bout.Offset() - off
exportf(bout, "\n$$\n")
// declaration for all imported symbols. The exception
// is declarations for Runtimepkg, which are populated
// by loadsys instead.
- if flagiexport && s.Pkg != Runtimepkg {
+ if s.Pkg != Runtimepkg {
Fatalf("missing ONONAME for %v\n", s)
}
flag.StringVar(&blockprofile, "blockprofile", "", "write block profile to `file`")
flag.StringVar(&mutexprofile, "mutexprofile", "", "write mutex profile to `file`")
flag.StringVar(&benchfile, "bench", "", "append benchmark times to `file`")
- flag.BoolVar(&flagiexport, "iexport", true, "export indexed package data")
objabi.Flagparse(usage)
// Record flags that affect the build result. (And don't
errorexit()
}
- // New indexed format is distinguished by an 'i' byte,
- // whereas old export format always starts with 'c', 'd', or 'v'.
- if c == 'i' {
- if !flagiexport {
- yyerror("import %s: cannot import package compiled with -iexport=true", file)
- errorexit()
- }
-
- iimport(importpkg, imp)
- } else {
- if flagiexport {
- yyerror("import %s: cannot import package compiled with -iexport=false", file)
- errorexit()
- }
-
- imp.UnreadByte()
- Import(importpkg, imp.Reader)
+ // Indexed format is distinguished by an 'i' byte,
+ // whereas previous export formats started with 'c', 'd', or 'v'.
+ if c != 'i' {
+ yyerror("import %s: unexpected package format byte: %v", file, c)
+ errorexit()
}
+ iimport(importpkg, imp)
default:
yyerror("no import in %q", path_)