1
0
mirror of https://github.com/golang/go synced 2024-11-12 07:40:23 -07:00

liblink: allow either of a pair of conflicting symbols to say dupok

This makes the linker's -X flag work again.

R=iant
CC=bradfitz, golang-codereviews, golang-dev
https://golang.org/cl/44360043
This commit is contained in:
Russ Cox 2013-12-19 16:52:47 -05:00
parent cbf6ff3b90
commit c9f12d2289

View 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