1
0
mirror of https://github.com/golang/go synced 2024-11-21 23:44:39 -07:00

ld: allow for IMAGE_REL_AMD64_ADDR32NB relocation type

enable cgo again on windows/amd64

R=rsc, vcc.163
CC=golang-dev
https://golang.org/cl/5488074
This commit is contained in:
Alex Brainman 2011-12-16 10:32:14 +11:00
parent b53856c16d
commit 2da651f115
2 changed files with 2 additions and 7 deletions

View File

@ -142,9 +142,6 @@ endif
ifeq ($(GOOS),netbsd) # ... and not on NetBSD
CGO_ENABLED:=0
endif
ifeq ($(GOOS)$(GOARCH),windowsamd64) # ... and not on Windows/amd64
CGO_ENABLED:=0
endif
endif
# Make environment more standard.

View File

@ -282,6 +282,8 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn)
diag("%s: unknown relocation type %d;", pn, type);
case IMAGE_REL_I386_REL32:
case IMAGE_REL_AMD64_REL32:
case IMAGE_REL_AMD64_ADDR32: // R_X86_64_PC32
case IMAGE_REL_AMD64_ADDR32NB:
rp->type = D_PCREL;
rp->add = le32(rsect->base+rp->off);
break;
@ -291,10 +293,6 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn)
// load addend from image
rp->add = le32(rsect->base+rp->off);
break;
case IMAGE_REL_AMD64_ADDR32: // R_X86_64_PC32
rp->type = D_PCREL;
rp->add += 4;
break;
case IMAGE_REL_AMD64_ADDR64: // R_X86_64_64
rp->siz = 8;
rp->type = D_ADDR;