2015-01-19 14:34:58 -05:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
package obj
|
|
|
|
|
|
|
|
|
|
import (
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
"fmt"
|
2015-01-19 14:34:58 -05:00
|
|
|
"math"
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
"os"
|
2015-01-19 14:34:58 -05:00
|
|
|
"strings"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// go-specific code shared across loaders (5l, 6l, 8l).
|
|
|
|
|
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
var Framepointer_enabled int
|
|
|
|
|
|
|
|
|
|
var fieldtrack_enabled int
|
|
|
|
|
|
|
|
|
|
var Zprog Prog
|
|
|
|
|
|
|
|
|
|
// Toolchain experiments.
|
|
|
|
|
// These are controlled by the GOEXPERIMENT environment
|
|
|
|
|
// variable recorded when the toolchain is built.
|
|
|
|
|
// This list is also known to cmd/gc.
|
|
|
|
|
var exper = []struct {
|
|
|
|
|
name string
|
|
|
|
|
val *int
|
|
|
|
|
}{
|
|
|
|
|
struct {
|
|
|
|
|
name string
|
|
|
|
|
val *int
|
|
|
|
|
}{"fieldtrack", &fieldtrack_enabled},
|
|
|
|
|
struct {
|
|
|
|
|
name string
|
|
|
|
|
val *int
|
|
|
|
|
}{"framepointer", &Framepointer_enabled},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func addexp(s string) {
|
|
|
|
|
var i int
|
|
|
|
|
|
|
|
|
|
for i = 0; i < len(exper); i++ {
|
|
|
|
|
if exper[i].name == s {
|
|
|
|
|
if exper[i].val != nil {
|
|
|
|
|
*exper[i].val = 1
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt.Printf("unknown experiment %s\n", s)
|
|
|
|
|
os.Exit(2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func linksetexp() {
|
|
|
|
|
for _, f := range strings.Split(goexperiment, ",") {
|
|
|
|
|
if f != "" {
|
|
|
|
|
addexp(f)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func expstring() string {
|
|
|
|
|
buf := "X"
|
|
|
|
|
for i := range exper {
|
|
|
|
|
if *exper[i].val != 0 {
|
|
|
|
|
buf += "," + exper[i].name
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if buf == "X" {
|
|
|
|
|
buf += ",none"
|
|
|
|
|
}
|
|
|
|
|
return "X:" + buf[2:]
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-19 14:34:58 -05:00
|
|
|
// replace all "". with pkg.
|
|
|
|
|
func expandpkg(t0 string, pkg string) string {
|
|
|
|
|
return strings.Replace(t0, `"".`, pkg+".", -1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func double2ieee(ieee *uint64, f float64) {
|
|
|
|
|
*ieee = math.Float64bits(f)
|
|
|
|
|
}
|