Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cmd/dist/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,7 @@ var cgoEnabled = map[string]bool{
"plan9/386": false,
"plan9/amd64": false,
"plan9/arm": false,
"plan9/arm64": false,
"solaris/amd64": true,
"windows/386": true,
"windows/amd64": true,
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/work/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,7 @@ var objectMagic = [][]byte{
{0x00, 0x00, 0x01, 0xEB}, // Plan 9 i386
{0x00, 0x00, 0x8a, 0x97}, // Plan 9 amd64
{0x00, 0x00, 0x06, 0x47}, // Plan 9 arm
{0x00, 0x00, 0x8c, 0x47}, // Plan 9 arm64
{0x00, 0x61, 0x73, 0x6D}, // WASM
{0x01, 0xDF}, // XCOFF 32bit
{0x01, 0xF7}, // XCOFF 64bit
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/go/testdata/script/work_env.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
go env GOWORK
stdout '^'$GOPATH'[\\/]src[\\/]go.work$'
go env
stdout '^(set )?GOWORK=''?'$GOPATH'[\\/]src[\\/]go.work''?$'
stdout '^(set )?GOWORK=["'']?'$GOPATH'[\\/]src[\\/]go.work["'']?$'

cd ..
go env GOWORK
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/internal/objfile/plan9obj.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ func (f *plan9File) goarch() string {
return "amd64"
case plan9obj.MagicARM:
return "arm"
case plan9obj.MagicARM64:
return "arm64"
}
return ""
}
Expand Down
9 changes: 6 additions & 3 deletions src/cmd/link/internal/arm64/obj.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func Init() (*sys.Arch, ld.Arch) {
Dwarfreglr: dwarfRegLR,
TrampLimit: 0x7c00000, // 26-bit signed offset * 4, leave room for PLT etc.

Plan9Magic: 0x8c47,
Plan9_64Bit: true,

Adddynrel: adddynrel,
Archinit: archinit,
Archreloc: archreloc,
Expand Down Expand Up @@ -85,12 +88,12 @@ func archinit(ctxt *ld.Link) {
ld.Exitf("unknown -H option: %v", ctxt.HeadType)

case objabi.Hplan9: /* plan 9 */
ld.HEADR = 32
ld.HEADR = 32 + 8
if *ld.FlagRound == -1 {
*ld.FlagRound = 4096
*ld.FlagRound = 0x10000
}
if *ld.FlagTextAddr == -1 {
*ld.FlagTextAddr = ld.Rnd(4096, *ld.FlagRound) + int64(ld.HEADR)
*ld.FlagTextAddr = ld.Rnd(0x10000, *ld.FlagRound) + int64(ld.HEADR)
}

case objabi.Hlinux, /* arm64 elf */
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/link/internal/ld/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func Main(arch *sys.Arch, theArch Arch) {
addstrdata1(ctxt, "runtime.buildVersion="+buildVersion)

// TODO(matloob): define these above and then check flag values here
if ctxt.Arch.Family == sys.AMD64 && buildcfg.GOOS == "plan9" {
if (ctxt.Arch.Family == sys.AMD64 || ctxt.Arch.Family == sys.ARM64) && buildcfg.GOOS == "plan9" {
flag.BoolVar(&flag8, "8", false, "use 64-bit addresses in symbol table")
}
flagHeadType := flag.String("H", "", "set header `type`")
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/link/internal/ld/symtab.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func putplan9sym(ctxt *Link, ldr *loader.Loader, s loader.Sym, char SymbolType)
}
l := 4
addr := ldr.SymValue(s)
if ctxt.IsAMD64() && !flag8 {
if (ctxt.IsAMD64() || ctxt.IsARM64()) && !flag8 {
ctxt.Out.Write32b(uint32(addr >> 32))
l = 8
}
Expand Down
28 changes: 28 additions & 0 deletions src/cmd/vendor/golang.org/x/sys/plan9/asm_plan9_arm64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

286 changes: 286 additions & 0 deletions src/cmd/vendor/golang.org/x/sys/plan9/zsyscall_plan9_arm64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading