Commit 2da651f1 authored by Alex Brainman's avatar Alex Brainman

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
parent b53856c1
...@@ -142,9 +142,6 @@ endif ...@@ -142,9 +142,6 @@ endif
ifeq ($(GOOS),netbsd) # ... and not on NetBSD ifeq ($(GOOS),netbsd) # ... and not on NetBSD
CGO_ENABLED:=0 CGO_ENABLED:=0
endif endif
ifeq ($(GOOS)$(GOARCH),windowsamd64) # ... and not on Windows/amd64
CGO_ENABLED:=0
endif
endif endif
# Make environment more standard. # Make environment more standard.
......
...@@ -282,6 +282,8 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn) ...@@ -282,6 +282,8 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn)
diag("%s: unknown relocation type %d;", pn, type); diag("%s: unknown relocation type %d;", pn, type);
case IMAGE_REL_I386_REL32: case IMAGE_REL_I386_REL32:
case IMAGE_REL_AMD64_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->type = D_PCREL;
rp->add = le32(rsect->base+rp->off); rp->add = le32(rsect->base+rp->off);
break; break;
...@@ -291,10 +293,6 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn) ...@@ -291,10 +293,6 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn)
// load addend from image // load addend from image
rp->add = le32(rsect->base+rp->off); rp->add = le32(rsect->base+rp->off);
break; 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 case IMAGE_REL_AMD64_ADDR64: // R_X86_64_64
rp->siz = 8; rp->siz = 8;
rp->type = D_ADDR; rp->type = D_ADDR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment