]> Cypherpunks repositories - gostls13.git/commitdiff
liblink: fix cmd/ld -X flag
authorRuss Cox <rsc@golang.org>
Fri, 26 Sep 2014 17:50:53 +0000 (13:50 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 26 Sep 2014 17:50:53 +0000 (13:50 -0400)
This fixes the test/linkx.go test, which does not run by default.
(Issue 4139 is about fixing that.)

Fixes #8806.

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/145420043

src/liblink/objfile.c

index 15d602df928f3d348a9193245d61b4c15dcbce80..b2478ec17847f9d130587f7cd39455e7881be5c9 100644 (file)
@@ -589,6 +589,8 @@ readsym(Link *ctxt, Biobuf *f, char *pkg, char *pn)
        typ = rdsym(ctxt, f, pkg);
        if(typ != nil) // if bss sym defined multiple times, take type from any one def
                s->gotype = typ;
+       if(dup != nil && typ != nil)
+               dup->gotype = typ;
        rddata(f, &s->p, &s->np);
        s->maxp = s->np;
        n = rdint(f);