From 1b2d5b4c9389aecc56a4547a9770d0c73925b248 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 6 Jan 2011 16:37:05 -0800 Subject: [PATCH] ld: Permit an ELF symbol to be exported in the dynamic symbol table. This permits exporting crosscall2 from the runtime/cgo package. R=rsc CC=golang-dev https://golang.org/cl/3885041 --- src/cmd/ld/ldelf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c index ccf6a412f7..44bbe68ee0 100644 --- a/src/cmd/ld/ldelf.c +++ b/src/cmd/ld/ldelf.c @@ -641,8 +641,10 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn) s->sub = sect->sym->sub; sect->sym->sub = s; s->type = sect->sym->type | SSUB; - s->dynimplib = nil; // satisfy dynimport - s->dynimpname = nil; // satisfy dynimport + if(!s->dynexport) { + s->dynimplib = nil; // satisfy dynimport + s->dynimpname = nil; // satisfy dynimport + } s->value = sym.value; s->size = sym.size; s->outer = sect->sym;