From ffc214da93bb6958b83ded0eff1bd2de21e82431 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 5 Dec 2014 19:13:20 -0500 Subject: all: power64 is now ppc64 Fixes issue 8654. LGTM=austin R=austin CC=golang-codereviews https://codereview.appspot.com/180600043 --- src/cmd/9a/doc.go | 4 ++-- src/cmd/9a/lex.c | 8 ++++---- src/cmd/9g/doc.go | 6 +++--- src/cmd/9g/galign.c | 8 ++++---- src/cmd/9g/ggen.c | 6 +++--- src/cmd/9g/peep.c | 4 ++-- src/cmd/9l/asm.c | 2 +- src/cmd/9l/doc.go | 6 +++--- src/cmd/9l/obj.c | 10 +++++----- src/cmd/cgo/main.go | 24 ++++++++++-------------- src/cmd/dist/build.c | 4 ++-- src/cmd/dist/unix.c | 4 ++-- src/cmd/internal/objfile/disasm.go | 10 +++++----- src/cmd/internal/objfile/elf.go | 2 +- src/cmd/internal/objfile/macho.go | 2 +- src/cmd/ld/ldelf.c | 4 ++-- src/cmd/objdump/objdump_test.go | 4 ++-- 17 files changed, 52 insertions(+), 56 deletions(-) (limited to 'src/cmd') diff --git a/src/cmd/9a/doc.go b/src/cmd/9a/doc.go index 44bf89dc0..f6eed6d86 100644 --- a/src/cmd/9a/doc.go +++ b/src/cmd/9a/doc.go @@ -14,8 +14,8 @@ Go-specific considerations are documented at http://golang.org/doc/asm -Its target architecture is the Power64, referred to by these tools as -power64 (big endian) or power64le (little endian). +Its target architecture is 64-bit PowerPC and Power Architecture processors, +referred to by these tools as ppc64 (big endian) or ppc64le (little endian). */ package main diff --git a/src/cmd/9a/lex.c b/src/cmd/9a/lex.c index e2945ef89..c8073b07d 100644 --- a/src/cmd/9a/lex.c +++ b/src/cmd/9a/lex.c @@ -71,7 +71,7 @@ dodef(char *p) Dlist[nDlist++] = p; } -LinkArch* thelinkarch = &linkpower64; +LinkArch* thelinkarch = &linkppc64; void usage(void) @@ -87,15 +87,15 @@ main(int argc, char *argv[]) char *p; thechar = '9'; - thestring = "power64"; + thestring = "ppc64"; // Allow GOARCH=thestring or GOARCH=thestringsuffix, // but not other values. p = getgoarch(); if(strncmp(p, thestring, strlen(thestring)) != 0) sysfatal("cannot use %cc with GOARCH=%s", thechar, p); - if(strcmp(p, "power64le") == 0) - thelinkarch = &linkpower64le; + if(strcmp(p, "ppc64le") == 0) + thelinkarch = &linkppc64le; ctxt = linknew(thelinkarch); ctxt->diag = yyerror; diff --git a/src/cmd/9g/doc.go b/src/cmd/9g/doc.go index 200be2eda..56bb14344 100644 --- a/src/cmd/9g/doc.go +++ b/src/cmd/9g/doc.go @@ -6,9 +6,9 @@ /* -9g is the version of the gc compiler for the Power64. -The $GOARCH for these tools is power64 (big endian) or -power64le (little endian). +9g is the version of the gc compiler for 64-bit PowerPC or Power Architecture processors. +The $GOARCH for these tools is ppc64 (big endian) or +ppc64le (little endian). It reads .go files and outputs .9 files. The flags are documented in ../gc/doc.go. diff --git a/src/cmd/9g/galign.c b/src/cmd/9g/galign.c index 97a5a5d06..67514faa4 100644 --- a/src/cmd/9g/galign.c +++ b/src/cmd/9g/galign.c @@ -7,17 +7,17 @@ #include "gg.h" int thechar = '9'; -char* thestring = "power64"; +char* thestring = "ppc64"; LinkArch* thelinkarch; void linkarchinit(void) { thestring = getgoarch(); - if(strcmp(thestring, "power64le") == 0) - thelinkarch = &linkpower64le; + if(strcmp(thestring, "ppc64le") == 0) + thelinkarch = &linkppc64le; else - thelinkarch = &linkpower64; + thelinkarch = &linkppc64; } vlong MAXWIDTH = 1LL<<50; diff --git a/src/cmd/9g/ggen.c b/src/cmd/9g/ggen.c index 7d9cf5050..f08c263c2 100644 --- a/src/cmd/9g/ggen.c +++ b/src/cmd/9g/ggen.c @@ -212,8 +212,8 @@ ginscall(Node *f, int proc) // However, the stack trace code will show the line // of the instruction byte before the return PC. // To avoid that being an unrelated instruction, - // insert a Power64 NOP that we will have the right line number. - // Power64 NOP is really or r0, r0, r0; use that description + // insert a ppc64 NOP that we will have the right line number. + // The ppc64 NOP is really or r0, r0, r0; use that description // because the NOP pseudo-instruction would be removed by // the linker. nodreg(®, types[TINT], D_R0); @@ -953,7 +953,7 @@ clearfat(Node *nl) f = sysfunc("duffzero"); p = gins(ADUFFZERO, N, f); afunclit(&p->to, f); - // 4 and 128 = magic constants: see ../../runtime/asm_power64x.s + // 4 and 128 = magic constants: see ../../runtime/asm_ppc64x.s p->to.offset = 4*(128-q); // duffzero leaves R3 on the last zeroed dword boff = 8; diff --git a/src/cmd/9g/peep.c b/src/cmd/9g/peep.c index 1f430220e..4e636b148 100644 --- a/src/cmd/9g/peep.c +++ b/src/cmd/9g/peep.c @@ -935,7 +935,7 @@ copyau1(Prog *p, Addr *v) } // copysub replaces v with s in a if f!=0 or indicates it if could if f==0. -// Returns 1 on failure to substitute (it always succeeds on power64). +// Returns 1 on failure to substitute (it always succeeds on ppc64). static int copysub(Addr *a, Addr *v, Addr *s, int f) { @@ -946,7 +946,7 @@ copysub(Addr *a, Addr *v, Addr *s, int f) } // copysub1 replaces v with s in p1->reg if f!=0 or indicates if it could if f==0. -// Returns 1 on failure to substitute (it always succeeds on power64). +// Returns 1 on failure to substitute (it always succeeds on ppc64). static int copysub1(Prog *p1, Addr *v, Addr *s, int f) { diff --git a/src/cmd/9l/asm.c b/src/cmd/9l/asm.c index 65a36285d..f9e2810ad 100644 --- a/src/cmd/9l/asm.c +++ b/src/cmd/9l/asm.c @@ -129,7 +129,7 @@ archreloc(Reloc *r, LSym *s, vlong *val) *val = symaddr(r->sym) + r->add - symaddr(linklookup(ctxt, ".got", 0)); return 0; case R_ADDRPOWER: - // r->add is two power64 instructions holding an immediate 32-bit constant. + // r->add is two ppc64 instructions holding an immediate 32-bit constant. // We want to add r->sym's address to that constant. // The encoding of the immediate x<<16 + y, // where x is the low 16 bits of the first instruction and y is the low 16 diff --git a/src/cmd/9l/doc.go b/src/cmd/9l/doc.go index 9df5dc614..3e3c48018 100644 --- a/src/cmd/9l/doc.go +++ b/src/cmd/9l/doc.go @@ -6,9 +6,9 @@ /* -9l is the linker for the Power64. -The $GOARCH for these tools is power64 (big endian) or -power64le (little endian). +9l is the linker for 64-bit PowerPC and Power Architecture processors. +The $GOARCH for these tools is ppc64 (big endian) or +ppc64le (little endian). The flags are documented in ../ld/doc.go. diff --git a/src/cmd/9l/obj.c b/src/cmd/9l/obj.c index badb72a1a..dab1ffb31 100644 --- a/src/cmd/9l/obj.c +++ b/src/cmd/9l/obj.c @@ -36,17 +36,17 @@ #include "../ld/dwarf.h" #include -char *thestring = "power64"; +char *thestring = "ppc64"; LinkArch *thelinkarch; void linkarchinit(void) { thestring = getgoarch(); - if(strcmp(thestring, "power64le") == 0) - thelinkarch = &linkpower64le; + if(strcmp(thestring, "ppc64le") == 0) + thelinkarch = &linkppc64le; else - thelinkarch = &linkpower64; + thelinkarch = &linkppc64; } void @@ -79,7 +79,7 @@ archinit(void) if(INITRND == -1) INITRND = 4096; break; - case Hlinux: /* power64 elf */ + case Hlinux: /* ppc64 elf */ debug['d'] = 1; // TODO(minux): dynamic linking is not supported yet. elfinit(); HEADR = ELFRESERVE; diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go index 28ded816d..911270383 100644 --- a/src/cmd/cgo/main.go +++ b/src/cmd/cgo/main.go @@ -130,23 +130,19 @@ func usage() { } var ptrSizeMap = map[string]int64{ - "386": 4, - "amd64": 8, - "arm": 4, - "ppc64": 8, - "ppc64le": 8, - "power64": 8, - "power64le": 8, + "386": 4, + "amd64": 8, + "arm": 4, + "ppc64": 8, + "ppc64le": 8, } var intSizeMap = map[string]int64{ - "386": 4, - "amd64": 8, - "arm": 4, - "ppc64": 8, - "ppc64le": 8, - "power64": 8, - "power64le": 8, + "386": 4, + "amd64": 8, + "arm": 4, + "ppc64": 8, + "ppc64le": 8, } var cPrefix string diff --git a/src/cmd/dist/build.c b/src/cmd/dist/build.c index 3743b7300..5feb77612 100644 --- a/src/cmd/dist/build.c +++ b/src/cmd/dist/build.c @@ -48,8 +48,8 @@ static char *okgoarch[] = { "amd64", "amd64p32", "386", - "power64", - "power64le", + "ppc64", + "ppc64le", }; // The known operating systems. diff --git a/src/cmd/dist/unix.c b/src/cmd/dist/unix.c index 893ed5cdd..0fd17c150 100644 --- a/src/cmd/dist/unix.c +++ b/src/cmd/dist/unix.c @@ -709,9 +709,9 @@ main(int argc, char **argv) else if(contains(u.machine, "arm")) gohostarch = "arm"; else if(contains(u.machine, "ppc64le")) - gohostarch = "power64le"; + gohostarch = "ppc64le"; else if(contains(u.machine, "ppc64")) - gohostarch = "power64"; + gohostarch = "ppc64"; else fatal("unknown architecture: %s", u.machine); } diff --git a/src/cmd/internal/objfile/disasm.go b/src/cmd/internal/objfile/disasm.go index 1a339c321..9838ce285 100644 --- a/src/cmd/internal/objfile/disasm.go +++ b/src/cmd/internal/objfile/disasm.go @@ -240,9 +240,9 @@ var disasms = map[string]disasmFunc{ } var byteOrders = map[string]binary.ByteOrder{ - "386": binary.LittleEndian, - "amd64": binary.LittleEndian, - "arm": binary.LittleEndian, - "power64": binary.BigEndian, - "power64le": binary.LittleEndian, + "386": binary.LittleEndian, + "amd64": binary.LittleEndian, + "arm": binary.LittleEndian, + "ppc64": binary.BigEndian, + "ppc64le": binary.LittleEndian, } diff --git a/src/cmd/internal/objfile/elf.go b/src/cmd/internal/objfile/elf.go index 17755b84d..305706d43 100644 --- a/src/cmd/internal/objfile/elf.go +++ b/src/cmd/internal/objfile/elf.go @@ -98,7 +98,7 @@ func (f *elfFile) goarch() string { case elf.EM_ARM: return "arm" case elf.EM_PPC64: - return "power64" + return "ppc64" } return "" } diff --git a/src/cmd/internal/objfile/macho.go b/src/cmd/internal/objfile/macho.go index 7dd84a339..a6cd02b93 100644 --- a/src/cmd/internal/objfile/macho.go +++ b/src/cmd/internal/objfile/macho.go @@ -104,7 +104,7 @@ func (f *machoFile) goarch() string { case macho.CpuArm: return "arm" case macho.CpuPpc64: - return "power64" + return "ppc64" } return "" } diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c index ec8e7c4ea..243c8d807 100644 --- a/src/cmd/ld/ldelf.c +++ b/src/cmd/ld/ldelf.c @@ -62,7 +62,7 @@ enum ElfMachSparc32Plus, /* SPARC V8+ */ ElfMach960, /* Intel 80960 */ ElfMachPower, /* PowerPC */ - ElfMachPower64, /* PowerPC 64 */ + ElfMachPower64, /* PowerPC 64-bit */ ElfMachS390, /* IBM System/390 */ ElfMachV800 = 36, /* NEC V800 */ ElfMachFr20, /* Fujitsu FR20 */ @@ -438,7 +438,7 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn) break; case '9': if(obj->machine != ElfMachPower64 || hdr->ident[4] != ElfClass64) { - diag("%s: elf object but not power64", pn); + diag("%s: elf object but not ppc64", pn); return; } break; diff --git a/src/cmd/objdump/objdump_test.go b/src/cmd/objdump/objdump_test.go index bd09ae9f9..513efbf96 100644 --- a/src/cmd/objdump/objdump_test.go +++ b/src/cmd/objdump/objdump_test.go @@ -102,7 +102,7 @@ func testDisasm(t *testing.T, flags ...string) { func TestDisasm(t *testing.T) { switch runtime.GOARCH { - case "power64", "power64le": + case "ppc64", "ppc64le": t.Skipf("skipping on %s, issue 9039", runtime.GOARCH) } testDisasm(t) @@ -114,7 +114,7 @@ func TestDisasmExtld(t *testing.T) { t.Skipf("skipping on %s", runtime.GOOS) } switch runtime.GOARCH { - case "power64", "power64le": + case "ppc64", "ppc64le": t.Skipf("skipping on %s, no support for external linking, issue 9038", runtime.GOARCH) } testDisasm(t, "-ldflags=-linkmode=external") -- cgit v1.2.1