Commit 98fff8ff authored by Kai Backman's avatar Kai Backman

dupok, gcc compile fix, sync and syscall asm fix

R=rsc
APPROVED=rsc
DELTA=27  (18 added, 0 deleted, 9 changed)
OCL=35503
CL=35505
parent 517839aa
......@@ -123,6 +123,7 @@ struct Sym
short become;
short frame;
uchar subtype;
uchar dupok;
uchar reachable;
int32 value;
int32 sig;
......
......@@ -564,6 +564,8 @@ loop:
}
if(p->to.offset > s->value)
s->value = p->to.offset;
if(p->reg & DUPOK)
s->dupok = 1;
break;
case ADYNT:
......@@ -627,10 +629,15 @@ loop:
break;
case ADATA:
// Assume that AGLOBL comes after ADATA.
// If we've seen an AGLOBL that said this sym was DUPOK,
// ignore any more ADATA we see, which must be
// redefinitions.
s = p->from.sym;
if(s == S) {
diag("DATA without a sym\n%P", p);
break;
if(s != S && s->dupok) {
if(debug['v'])
Bprint(&bso, "skipping %s in %s: dupok\n", s->name, pn);
goto loop;
}
if(s != S) {
p->dlink = s->data;
......
......@@ -561,10 +561,15 @@ find1(int32 l, int c)
int
find2(int32 l, int c)
{
union {
int32 l;
short p[2];
} u;
short *p;
int i;
p = (short*)&l;
u.l = l;
p = u.p;
for(i=0; i<4; i+=2) {
if(((*p >> 8) & 0xff) == c)
return i;
......
......@@ -22,7 +22,8 @@ TEXT syscall·Syscall(SB),7,$0
SWI $SYS_syscall
MOVW R0, 20(SP) // r1
MOVW R1, 24(SP) // r2
MOVW $0, 28(SP) // errno
MOVW $0, R0
MOVW R0, 28(SP) // errno
BL sys·exitsyscall(SB)
RET
......@@ -40,7 +41,8 @@ TEXT syscall·Syscall6(SB),7,$0
SWI $SYS_syscall
MOVW R0, 32(SP) // r1
MOVW R1, 36(SP) // r2
MOVW $0, 40(SP) // errno
MOVW $0, R0
MOVW R0, 40(SP) // errno
BL sys·exitsyscall(SB)
RET
......@@ -53,5 +55,6 @@ TEXT syscall·RawSyscall(SB),7,$0
SWI $SYS_syscall
MOVW R0, 20(SP) // r1
MOVW R1, 24(SP) // r2
MOVW $0, 28(SP) // errno
MOVW $0, R0
MOVW R0, 28(SP) // errno
RET
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