Commit 5a529b61 authored by Ian Lance Taylor's avatar Ian Lance Taylor

cmd/ld: permit sym to be both cgo_export_static and cgo_export_dynamic

Fixes SWIG callbacks.  Previously crosscall2 was only
cgo_export_static, despite the use of two #pragma declarations
in runtime/cgo/callbacks.c.

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7817048
parent 35c85321
...@@ -508,10 +508,6 @@ loadcgo(char *file, char *pkg, char *p, int n) ...@@ -508,10 +508,6 @@ loadcgo(char *file, char *pkg, char *p, int n)
} }
if(s->cgoexport == 0) { if(s->cgoexport == 0) {
if(strcmp(f[0], "cgo_export_static") == 0)
s->cgoexport |= CgoExportStatic;
else
s->cgoexport |= CgoExportDynamic;
s->extname = remote; s->extname = remote;
if(ndynexp%32 == 0) if(ndynexp%32 == 0)
dynexp = erealloc(dynexp, (ndynexp+32)*sizeof dynexp[0]); dynexp = erealloc(dynexp, (ndynexp+32)*sizeof dynexp[0]);
...@@ -521,6 +517,10 @@ loadcgo(char *file, char *pkg, char *p, int n) ...@@ -521,6 +517,10 @@ loadcgo(char *file, char *pkg, char *p, int n)
nerrors++; nerrors++;
return; return;
} }
if(strcmp(f[0], "cgo_export_static") == 0)
s->cgoexport |= CgoExportStatic;
else
s->cgoexport |= CgoExportDynamic;
if(local != f[1]) if(local != f[1])
free(local); free(local);
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment