]> git.lizzy.rs Git - plan9front.git/commitdiff
7l: handle dupok flag in TEXT/GLOBL data
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sun, 17 May 2020 17:08:10 +0000 (19:08 +0200)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sun, 17 May 2020 17:08:10 +0000 (19:08 +0200)
sys/src/cmd/7l/asm.c
sys/src/cmd/7l/l.h
sys/src/cmd/7l/obj.c

index 0cc5a27ec4618f97d89ec3d2ab983c6b06fa7045..0b3b444faa8c6eb06aecbcacc531ac99227892e1 100644 (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);
index 55ff29b8d0ce8a024741842e31aa8aa0db0a1141..8d13a7914820fa0d65adb82c6ade4f8e9ea19bd7 100644 (file)
@@ -81,6 +81,7 @@ struct        Sym
        short   version;
        short   become;
        short   frame;
+       char    dupok;
        uchar   subtype;
        ushort  file;
        vlong   value;
index fc709843de35202cb8be1ae9a31ab240263824c2..081e7ed0b822524f3c9e1d000615f117413a6434 100644 (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;
 }