From fa113cf767ac330b836966c4e75b6b21566da095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aram=20H=C4=83v=C4=83rneanu?= Date: Wed, 9 Jul 2014 12:32:49 +0200 Subject: [PATCH] cmd/objdump: set goarch properly on non-386 Plan 9 systems LGTM=0intro, r R=0intro, r CC=ality, golang-codereviews, jas, mischief https://golang.org/cl/108420043 --- src/cmd/objdump/plan9obj.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cmd/objdump/plan9obj.go b/src/cmd/objdump/plan9obj.go index 34462f31c5..f851d4158c 100644 --- a/src/cmd/objdump/plan9obj.go +++ b/src/cmd/objdump/plan9obj.go @@ -34,7 +34,14 @@ func plan9Symbols(f *os.File) (syms []Sym, goarch string) { return } - goarch = "386" + switch p.Magic { + case plan9obj.MagicAMD64: + goarch = "amd64" + case plan9obj.Magic386: + goarch = "386" + case plan9obj.MagicARM: + goarch = "arm" + } // Build sorted list of addresses of all symbols. // We infer the size of a symbol by looking at where the next symbol begins.