}
}
- var off int32
for _, s := range ctxt.Textp {
put(ctxt, s, s.Name, TextSym, s.Value, s.Gotype)
if s.FuncInfo == nil {
continue
}
- for _, a := range s.FuncInfo.Autom {
- if a.Name == objabi.A_DELETED_AUTO {
- put(ctxt, nil, "", DeletedAutoSym, 0, a.Gotype)
- continue
- }
-
- // Emit a or p according to actual offset, even if label is wrong.
- // This avoids negative offsets, which cannot be encoded.
- if a.Name != objabi.A_AUTO && a.Name != objabi.A_PARAM {
- continue
- }
-
- // compute offset relative to FP
- if a.Name == objabi.A_PARAM {
- off = a.Aoffset
- } else {
- off = a.Aoffset - int32(ctxt.Arch.PtrSize)
- }
-
- // FP
- if off >= 0 {
- put(ctxt, nil, a.Asym.Name, ParamSym, int64(off), a.Gotype)
- continue
- }
-
- // SP
- if off <= int32(-ctxt.Arch.PtrSize) {
- put(ctxt, nil, a.Asym.Name, AutoSym, -(int64(off) + int64(ctxt.Arch.PtrSize)), a.Gotype)
- continue
- }
- // Otherwise, off is addressing the saved program counter.
- // Something underhanded is going on. Say nothing.
- }
}
if ctxt.Debugvlog != 0 || *flagN {
data []byte
reloc []sym.Reloc
pcdata []sym.Pcdata
- autom []sym.Auto
funcdata []*sym.Symbol
funcdataoff []int64
file []*sym.Symbol
r.reloc = make([]sym.Reloc, n)
n = r.readInt()
r.pcdata = make([]sym.Pcdata, n)
- n = r.readInt()
- r.autom = make([]sym.Auto, n)
+ _ = r.readInt() // TODO: remove on next object file rev (autom count)
n = r.readInt()
r.funcdata = make([]*sym.Symbol, n)
r.funcdataoff = make([]int64, n)
s.Attr |= sym.AttrTopFrame
}
n := r.readInt()
- pc.Autom = r.autom[:n:n]
- if !isdup {
- r.autom = r.autom[n:]
+ if n != 0 {
+ log.Fatalf("stale object file: autom count nonzero")
}
- for i := 0; i < n; i++ {
- pc.Autom[i] = sym.Auto{
- Asym: r.readSymIndex(),
- Aoffset: r.readInt32(),
- Name: r.readInt16(),
- Gotype: r.readSymIndex(),
- }
- }
-
- // Temporary: zero out the autom list after we've read it.
- // In a subsequent patch we'll remove autom handling more completely.
- pc.Autom = nil
-
pc.Pcsp.P = r.readData()
pc.Pcfile.P = r.readData()
pc.Pcline.P = r.readData()