1
0
mirror of https://github.com/golang/go synced 2024-11-13 18:50:24 -07:00

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
This commit is contained in:
Kai Backman 2009-10-08 22:16:08 -07:00
parent 517839aa40
commit 98fff8ffb2
4 changed files with 23 additions and 7 deletions

View File

@ -123,6 +123,7 @@ struct Sym
short become;
short frame;
uchar subtype;
uchar dupok;
uchar reachable;
int32 value;
int32 sig;

View File

@ -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;

View File

@ -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;

View File

@ -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