• Matthew Dempsky's avatar
    cmd/compile: cleanup mkbuiltin.go · 7555f7f2
    Matthew Dempsky authored
    Changes largely in preparation for eventually switching the builtin
    export data to use the new binary format.
    
    Replace fancy incremental line-by-line scanning with simply reading
    the entire object file into memory, finding the export data section,
    and processing it that way.
    
    Just use "package runtime" and "package unsafe" in the builtin Go
    source files so we don't need to rewrite references to "PACKAGE".
    
    Stop looking for init_PACKAGE_function; it doesn't exist anyway.
    
    Compile package runtime with -u so that its export data marks it as a
    "safe" package.
    
    Eliminate requirement to pass "runtime" and "unsafe" as command-line
    arguments so that just "go run mkbuiltin.go" works.
    
    Only rewrite builtin.go when successful.
    
    Change-Id: I4addfde9e0cfb30607c7a83de686bde0ad1f035a
    Reviewed-on: https://go-review.googlesource.com/19624Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
    Run-TryBot: Robert Griesemer <gri@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    7555f7f2
builtin.go 12.1 KB