Commit 4890502a authored by Russ Cox's avatar Russ Cox

liblink: use explicit field for globl duplicate detection

Overloading size leads to problems if clients
try to set up an LSym by hand.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/44140043
parent 2404b7f1
...@@ -131,6 +131,7 @@ struct LSym ...@@ -131,6 +131,7 @@ struct LSym
uchar hide; uchar hide;
uchar leaf; // arm only uchar leaf; // arm only
uchar fnptr; // arm only uchar fnptr; // arm only
uchar seenglobl;
int16 symid; // for writing .5/.6/.8 files int16 symid; // for writing .5/.6/.8 files
int32 dynid; int32 dynid;
int32 sig; int32 sig;
......
...@@ -167,7 +167,8 @@ linkwriteobj(Link *ctxt, Biobuf *b) ...@@ -167,7 +167,8 @@ linkwriteobj(Link *ctxt, Biobuf *b)
if(p->as == ctxt->arch->AGLOBL) { if(p->as == ctxt->arch->AGLOBL) {
s = p->from.sym; s = p->from.sym;
if(s->size) print("duplicate %P\n", p); if(s->seenglobl++)
print("duplicate %P\n", p);
if(data == nil) if(data == nil)
data = s; data = s;
else else
......
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