Skip to content

cmd/link, runtime: reserve 48 bytes in stack frame for ppc64 #31738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
10 changes: 0 additions & 10 deletions src/cmd/link/internal/ld/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,6 @@ func determineLinkMode(ctxt *Link) {
}
ctxt.LinkMode = LinkInternal
case "1":
if objabi.GOARCH == "ppc64" && objabi.GOOS != "aix" {
Exitf("external linking requested via GO_EXTLINK_ENABLED but not supported for %s/ppc64", objabi.GOOS)
}
ctxt.LinkMode = LinkExternal
default:
if needed, _ := mustLinkExternal(ctxt); needed {
Expand All @@ -261,17 +258,10 @@ func determineLinkMode(ctxt *Link) {
} else {
ctxt.LinkMode = LinkInternal
}
if objabi.GOARCH == "ppc64" && objabi.GOOS != "aix" && ctxt.LinkMode == LinkExternal {
Exitf("external linking is not supported for %s/ppc64", objabi.GOOS)
}
}
case LinkInternal:
if needed, reason := mustLinkExternal(ctxt); needed {
Exitf("internal linking requested but external linking required: %s", reason)
}
case LinkExternal:
if objabi.GOARCH == "ppc64" && objabi.GOOS != "aix" {
Exitf("external linking not supported for %s/ppc64", objabi.GOOS)
}
}
}
4 changes: 2 additions & 2 deletions src/runtime/asm_ppc64x.s
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "textflag.h"
#include "asm_ppc64x.h"

#ifdef GOOS_aix
#ifdef GOARCH_ppc64
#define cgoCalleeStackSize 48
#else
#define cgoCalleeStackSize 32
Expand Down Expand Up @@ -562,7 +562,7 @@ TEXT gosave<>(SB),NOSPLIT|NOFRAME,$0
BL runtime·badctxt(SB)
RET

#ifdef GOOS_aix
#ifdef GOARCH_ppc64
#define asmcgocallSaveOffset cgoCalleeStackSize + 8
#else
#define asmcgocallSaveOffset cgoCalleeStackSize
Expand Down
1 change: 1 addition & 0 deletions src/runtime/rt0_linux_ppc64.s
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ TEXT _main<>(SB),NOSPLIT,$-8
// There is no TLS base pointer.
//
// TODO(austin): Support ABI v1 dynamic linking entry point
XOR R0, R0 // following functions assume R0 is zero
MOVD $runtime·rt0_go(SB), R12
MOVD R12, CTR
MOVBZ runtime·iscgo(SB), R5
Expand Down