import (
"bytes"
"cmd/internal/obj"
- "fmt"
"log"
"strconv"
"strings"
ctxt.Etextp = s
}
}
-
- if ctxt.Debugasm != 0 {
- fmt.Fprintf(ctxt.Bso, "%s ", s.Name)
- if s.Version != 0 {
- fmt.Fprintf(ctxt.Bso, "v=%d ", s.Version)
- }
- if s.Type != 0 {
- fmt.Fprintf(ctxt.Bso, "t=%d ", s.Type)
- }
- if s.Attr.DuplicateOK() {
- fmt.Fprintf(ctxt.Bso, "dupok ")
- }
- if s.Attr.NoSplit() {
- fmt.Fprintf(ctxt.Bso, "nosplit ")
- }
- fmt.Fprintf(ctxt.Bso, "size=%d value=%d", int64(s.Size), int64(s.Value))
- if s.Type == obj.STEXT {
- fmt.Fprintf(ctxt.Bso, " args=%#x locals=%#x", uint64(s.Args), uint64(s.Locals))
- }
- fmt.Fprintf(ctxt.Bso, "\n")
- var c int
- var j int
- for i := 0; i < len(s.P); {
- fmt.Fprintf(ctxt.Bso, "\t%#04x", uint(i))
- for j = i; j < i+16 && j < len(s.P); j++ {
- fmt.Fprintf(ctxt.Bso, " %02x", s.P[j])
- }
- for ; j < i+16; j++ {
- fmt.Fprintf(ctxt.Bso, " ")
- }
- fmt.Fprintf(ctxt.Bso, " ")
- for j = i; j < i+16 && j < len(s.P); j++ {
- c = int(s.P[j])
- if ' ' <= c && c <= 0x7e {
- fmt.Fprintf(ctxt.Bso, "%c", c)
- } else {
- fmt.Fprintf(ctxt.Bso, ".")
- }
- }
-
- fmt.Fprintf(ctxt.Bso, "\n")
- i += 16
- }
-
- var r *Reloc
- for i := 0; i < len(s.R); i++ {
- r = &s.R[i]
- fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%d\n", int(r.Off), r.Siz, r.Type, r.Sym.Name, int64(r.Add))
- }
- }
}
func readref(ctxt *Link, f *obj.Biobuf, pkg string, pn string) {