]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/objdump: set goarch properly on non-386 Plan 9 systems
authorAram Hăvărneanu <aram@mgk.ro>
Wed, 9 Jul 2014 10:32:49 +0000 (12:32 +0200)
committerAram Hăvărneanu <aram@mgk.ro>
Wed, 9 Jul 2014 10:32:49 +0000 (12:32 +0200)
LGTM=0intro, r
R=0intro, r
CC=ality, golang-codereviews, jas, mischief
https://golang.org/cl/108420043

src/cmd/objdump/plan9obj.go

index 34462f31c5f28a6acf4476acc04da36f27b0f7f6..f851d4158c2e61a81ff0a9203d583ea074cf0150 100644 (file)
@@ -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.