]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/ld: cast PE32 absolute addend to int32.
authorShenghou Ma <minux.ma@gmail.com>
Wed, 16 Apr 2014 05:46:56 +0000 (01:46 -0400)
committerShenghou Ma <minux.ma@gmail.com>
Wed, 16 Apr 2014 05:46:56 +0000 (01:46 -0400)
Didn't manage to find a way to write test cases.

Fixes #7769.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/88000045

src/cmd/ld/ldpe.c

index 57ef61c57e9e5d065d1e5558de0f37392eb1bba7..1f1a51fad1fff8f350984a2b0c9be11160b1a62a 100644 (file)
@@ -297,7 +297,7 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn)
                                case IMAGE_REL_I386_DIR32:
                                        rp->type = R_ADDR;
                                        // load addend from image
-                                       rp->add = le32(rsect->base+rp->off);
+                                       rp->add = (int32)le32(rsect->base+rp->off);
                                        break;
                                case IMAGE_REL_AMD64_ADDR64: // R_X86_64_64
                                        rp->siz = 8;