]> Cypherpunks repositories - gostls13.git/commitdiff
ld: fixes ldpe link with SXREF global values.
authorWei Guangjing <vcc.163@gmail.com>
Sat, 23 Jul 2011 01:21:08 +0000 (21:21 -0400)
committerRuss Cox <rsc@golang.org>
Sat, 23 Jul 2011 01:21:08 +0000 (21:21 -0400)
R=golang-dev, mattn.jp, rsc
CC=golang-dev
https://golang.org/cl/4794052

src/cmd/ld/ldpe.c

index 3e2b57112af589e6631a5dd5b385adf2df713fba..3423b71a18e0267a3fc4d9502e67f5590b36eac6 100644 (file)
@@ -327,6 +327,10 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn)
                if(sym->sectnum == 0) {// extern
                        if(s->type == SDYNIMPORT)
                                s->plt = -2; // flag for dynimport in PE object files.
+                       if (s->type == SXREF && sym->value > 0) {// global data
+                               s->type = SDATA; 
+                               s->size = sym->value;
+                       }
                        continue;
                } else if (sym->sectnum > 0) {
                        sect = &obj->sect[sym->sectnum-1];