mirror of
https://github.com/golang/go
synced 2024-11-21 20:04:44 -07:00
ld: fix link Windows PE __declspec(dllimport) symbol
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4568077
This commit is contained in:
parent
2ad42a8249
commit
9e2ffc315f
@ -249,7 +249,7 @@ dynrelocsym(Sym *s)
|
||||
return;
|
||||
for(r=s->r; r<s->r+s->nr; r++) {
|
||||
targ = r->sym;
|
||||
if(r->sym->plt == -2) { // make dynimport JMP table for PE object files.
|
||||
if(r->sym->plt == -2 && r->sym->got != -2) { // make dynimport JMP table for PE object files.
|
||||
targ->plt = rel->size;
|
||||
r->sym = rel;
|
||||
r->add = targ->plt;
|
||||
|
@ -403,6 +403,8 @@ readsym(PeObj *obj, int i, PeSym **y)
|
||||
|
||||
if(s != nil && s->type == 0 && !(sym->sclass == IMAGE_SYM_CLASS_STATIC && sym->value == 0))
|
||||
s->type = SXREF;
|
||||
if(strncmp(sym->name, "__imp__", 6) == 0)
|
||||
s->got = -2; // flag for __imp__
|
||||
sym->sym = s;
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user