Commit 1cb86e28 authored by Cherry Zhang's avatar Cherry Zhang

cmd/internal/objfile: allow disassemble amd64p32 binaries

Change-Id: Ifa7701e97c0ec7d113e952b2b366edf422d6df2f
Reviewed-on: https://go-review.googlesource.com/69351
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 3860478b
......@@ -243,7 +243,7 @@ func (d *Disasm) Print(w io.Writer, filter *regexp.Regexp, start, end uint64, pr
fmt.Fprintf(tw, " %s:%d\t%#x\t", base(file), line, pc)
}
if size%4 != 0 || d.goarch == "386" || d.goarch == "amd64" {
if size%4 != 0 || d.goarch == "386" || d.goarch == "amd64" || d.goarch == "amd64p32" {
// Print instruction as bytes.
fmt.Fprintf(tw, "%x", code[i:i+size])
} else {
......@@ -374,22 +374,24 @@ func disasm_ppc64(code []byte, pc uint64, lookup lookupFunc, byteOrder binary.By
}
var disasms = map[string]disasmFunc{
"386": disasm_386,
"amd64": disasm_amd64,
"arm": disasm_arm,
"arm64": disasm_arm64,
"ppc64": disasm_ppc64,
"ppc64le": disasm_ppc64,
"386": disasm_386,
"amd64": disasm_amd64,
"amd64p32": disasm_amd64,
"arm": disasm_arm,
"arm64": disasm_arm64,
"ppc64": disasm_ppc64,
"ppc64le": disasm_ppc64,
}
var byteOrders = map[string]binary.ByteOrder{
"386": binary.LittleEndian,
"amd64": binary.LittleEndian,
"arm": binary.LittleEndian,
"arm64": binary.LittleEndian,
"ppc64": binary.BigEndian,
"ppc64le": binary.LittleEndian,
"s390x": binary.BigEndian,
"386": binary.LittleEndian,
"amd64": binary.LittleEndian,
"amd64p32": binary.LittleEndian,
"arm": binary.LittleEndian,
"arm64": binary.LittleEndian,
"ppc64": binary.BigEndian,
"ppc64le": binary.LittleEndian,
"s390x": binary.BigEndian,
}
type Liner interface {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment