]> Cypherpunks repositories - gostls13.git/commitdiff
liblink: allow either of a pair of conflicting symbols to say dupok
authorRuss Cox <rsc@golang.org>
Thu, 19 Dec 2013 21:52:47 +0000 (16:52 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 19 Dec 2013 21:52:47 +0000 (16:52 -0500)
This makes the linker's -X flag work again.

R=iant
CC=bradfitz, golang-codereviews, golang-dev
https://golang.org/cl/44360043

src/liblink/objfile.c

index 94a2561062a82573309250360ee5541ef558eadd..52ec90d6886760d41cb508235860de39d58bfa48 100644 (file)
@@ -503,7 +503,7 @@ readsym(Link *ctxt, Biobuf *f, char *pkg, char *pn)
                v = ctxt->version;
        s = linklookup(ctxt, name, v);
        if(s->type != 0 && s->type != SXREF) {
-               if(s->type != SBSS && s->type != SNOPTRBSS && (!dupok || !s->dupok))
+               if(s->type != SBSS && s->type != SNOPTRBSS && !dupok && !s->dupok)
                        sysfatal("duplicate symbol %s (types %d and %d) in %s and %s", s->name, s->type, t, s->file, pn);
                if(s->np > 0)
                        s = linklookup(ctxt, ".dup", ndup++); // scratch