7l: handle dupok flag in TEXT/GLOBL data

This commit is contained in:
cinap_lenrek 2020-05-17 19:08:10 +02:00
parent f860f25f05
commit b599dc0e54
3 changed files with 5 additions and 2 deletions

View file

@ -493,7 +493,7 @@ datblk(long s, long n, int str)
}
if(l >= n)
continue;
if(p->as != AINIT && p->as != ADYNT) {
if(p->as != AINIT && p->as != ADYNT && !p->from.sym->dupok) {
for(j=l+(c-i)-1; j>=l; j--)
if(buf.dbuf[j]) {
print("%P\n", p);

View file

@ -81,6 +81,7 @@ struct Sym
short version;
short become;
short frame;
char dupok;
uchar subtype;
ushort file;
vlong value;

View file

@ -839,6 +839,8 @@ loop:
diag("GLOBL must have a name\n%P", p);
errorexit();
}
if(p->reg & DUPOK)
s->dupok = 1;
if(s->type == 0 || s->type == SXREF) {
s->type = SBSS;
s->value = 0;
@ -1122,7 +1124,7 @@ lookup(char *symb, int v)
s->version = v;
s->value = 0;
s->sig = 0;
// s->dupok = 0;
s->dupok = 0;
hash[h] = s;
return s;
}