return int32(pcln.Lastindex)
}
- var i int32
- for i = 0; i < int32(len(pcln.File)); i++ {
- file := pcln.File[i]
+ for i, file := range pcln.File {
if file == f {
pcln.Lastfile = f
- pcln.Lastindex = int(i)
- return i
+ pcln.Lastindex = i
+ return int32(i)
}
}
+ i := len(pcln.File)
pcln.File = append(pcln.File, f)
pcln.Lastfile = f
- pcln.Lastindex = int(i)
- return i
+ pcln.Lastindex = i
+ return int32(i)
}
// pctospadj computes the sp adjustment in effect.
}
func machosymtab() {
- var s *LSym
- var o *LSym
- var p string
-
symtab := Linklookup(Ctxt, ".machosymtab", 0)
symstr := Linklookup(Ctxt, ".machosymstr", 0)
for i := 0; i < nsortsym; i++ {
- s = sortsym[i]
+ s := sortsym[i]
Adduint32(Ctxt, symtab, uint32(symstr.Size))
// Only add _ to C symbols. Go symbols have dot in the name.
}
// replace "·" as ".", because DTrace cannot handle it.
- if !strings.Contains(s.Extname, "·") {
- Addstring(symstr, s.Extname)
- } else {
- for p = s.Extname; p != ""; p = p[1:] {
- if p[0] == 0xc2 && (p[1:])[0] == 0xb7 {
- Adduint8(Ctxt, symstr, '.')
- p = p[1:]
- } else {
- Adduint8(Ctxt, symstr, p[0])
- }
- }
-
- Adduint8(Ctxt, symstr, '\x00')
- }
+ Addstring(symstr, strings.Replace(s.Extname, "·", ".", -1))
if s.Type == obj.SDYNIMPORT || s.Type == obj.SHOSTOBJ {
Adduint8(Ctxt, symtab, 0x01) // type N_EXT, external symbol
} else {
Adduint8(Ctxt, symtab, 0x0e)
}
- o = s
+ o := s
for o.Outer != nil {
o = o.Outer
}