]> Cypherpunks repositories - gostls13.git/commitdiff
6l: pe fixes
authorWei Guangjing <vcc.163@gmail.com>
Thu, 17 Feb 2011 23:58:47 +0000 (10:58 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Thu, 17 Feb 2011 23:58:47 +0000 (10:58 +1100)
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/4182061

src/cmd/6l/pass.c
src/cmd/ld/pe.c

index 5eb221a35d2502fd5e472336de87ae0b06e0b284..d6d93ee4bd8d67114efae829055939be4cf17378 100644 (file)
@@ -289,7 +289,7 @@ patch(void)
                        // a different method is used to access them.
                        if(p->from.type == D_INDIR+D_GS
                        && p->to.type >= D_AX && p->to.type <= D_DI 
-                       && p->from.offset != 0x58) {
+                       && p->from.offset <= 8) {
                                q = appendp(p);
                                q->from = p->from;
                                q->from.type = D_INDIR + p->to.type;
index 995809f5f2f54203b100f747b50a8ff313fbb611..425fd9e091e6912324e86147780ddca6c9c54dd4 100644 (file)
@@ -500,6 +500,7 @@ asmbpe(void)
                IMAGE_FILE_EXECUTABLE_IMAGE|IMAGE_FILE_DEBUG_STRIPPED;
        if (pe64) {
                fh.SizeOfOptionalHeader = sizeof(oh64);
+               fh.Characteristics |= IMAGE_FILE_LARGE_ADDRESS_AWARE;
                set(Magic, 0x20b);      // PE32+
        } else {
                fh.SizeOfOptionalHeader = sizeof(oh);