]> Cypherpunks repositories - gostls13.git/commitdiff
ld: allow for IMAGE_REL_AMD64_ADDR32NB relocation type
authorAlex Brainman <alex.brainman@gmail.com>
Thu, 15 Dec 2011 23:32:14 +0000 (10:32 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Thu, 15 Dec 2011 23:32:14 +0000 (10:32 +1100)
enable cgo again on windows/amd64

R=rsc, vcc.163
CC=golang-dev
https://golang.org/cl/5488074

src/Make.inc
src/cmd/ld/ldpe.c

index 9dc7b8c1c6353554b02cedb879e029e5e64bf280..7b4ccd0aeeb90d4edc90d34c601cfb9ddf8a9f0d 100644 (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.
index 8d175b1156c6e505ed8676979e7ad60d1825b2a2..feb8620bdb1bde9ac1e8df266db42dcf6872fb45 100644 (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;