mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[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>
This commit is contained in:
parent
8db173b85e
commit
1fc330d8fe
54 changed files with 6531 additions and 6787 deletions
|
|
@ -25,10 +25,19 @@ func Cputime() float64 {
|
|||
type Biobuf struct {
|
||||
unget int
|
||||
haveUnget bool
|
||||
f *os.File
|
||||
r *bufio.Reader
|
||||
w *bufio.Writer
|
||||
}
|
||||
|
||||
func Bopenw(name string) (*Biobuf, error) {
|
||||
f, err := os.Open(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Biobuf{f: f, w: bufio.NewWriter(f)}, nil
|
||||
}
|
||||
|
||||
func Binitw(w io.Writer) *Biobuf {
|
||||
return &Biobuf{w: bufio.NewWriter(w)}
|
||||
}
|
||||
|
|
@ -75,6 +84,15 @@ func Bflush(b *Biobuf) error {
|
|||
return b.w.Flush()
|
||||
}
|
||||
|
||||
func Bterm(b *Biobuf) error {
|
||||
err := b.w.Flush()
|
||||
err1 := b.f.Close()
|
||||
if err == nil {
|
||||
err = err1
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func envOr(key, value string) string {
|
||||
if x := os.Getenv(key); x != "" {
|
||||
return x
|
||||
|
|
@ -108,7 +126,7 @@ func Atoi(s string) int {
|
|||
}
|
||||
|
||||
func (p *Prog) Line() string {
|
||||
return linklinefmt(p.Ctxt, int(p.Lineno), false, false)
|
||||
return Linklinefmt(p.Ctxt, int(p.Lineno), false, false)
|
||||
}
|
||||
|
||||
func (p *Prog) String() string {
|
||||
|
|
@ -119,7 +137,11 @@ func (p *Prog) String() string {
|
|||
}
|
||||
|
||||
func (ctxt *Link) NewProg() *Prog {
|
||||
p := ctxt.Arch.Prg() // should be the only call to this; all others should use ctxt.NewProg
|
||||
p := new(Prog) // should be the only call to this; all others should use ctxt.NewProg
|
||||
p.Ctxt = ctxt
|
||||
return p
|
||||
}
|
||||
|
||||
func (ctxt *Link) Line(n int) string {
|
||||
return Linklinefmt(ctxt, n, false, false)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue