mirror of
https://github.com/golang/go
synced 2024-11-13 14:00:27 -07:00
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
This commit is contained in:
parent
2404b7f168
commit
4890502af6
@ -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)
|
|||||||
|
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user