From da9b38c75c11cc7f18415849b5bf14579ef8317c Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 19 Mar 2017 03:05:24 +0100 Subject: 5l,6l,8l,kl,ql,vl: allow duplicate GLOBAL symbols (from Ori Bernstein) The plan 9 assemblers support the DUPOK flag on text symbols. They parse and ignore it on GLOBL symbols. This patch makes it work in the linkers. The reason I ran into this is because my programming language (Myrddin) uses data symbols to generate type information, and it's useful to avoid duplicating all of the type info in every file that gets generated. --- sys/src/cmd/ql/asm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/src/cmd/ql/asm.c') diff --git a/sys/src/cmd/ql/asm.c b/sys/src/cmd/ql/asm.c index 8930ddae8..b980aff8e 100644 --- a/sys/src/cmd/ql/asm.c +++ b/sys/src/cmd/ql/asm.c @@ -756,7 +756,7 @@ datblk(long s, long n) } 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); -- cgit v1.2.3