mirror of
https://github.com/golang/go
synced 2024-11-22 16:54:48 -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:
parent
517839aa40
commit
98fff8ffb2
@ -123,6 +123,7 @@ struct Sym
|
|||||||
short become;
|
short become;
|
||||||
short frame;
|
short frame;
|
||||||
uchar subtype;
|
uchar subtype;
|
||||||
|
uchar dupok;
|
||||||
uchar reachable;
|
uchar reachable;
|
||||||
int32 value;
|
int32 value;
|
||||||
int32 sig;
|
int32 sig;
|
||||||
|
@ -564,6 +564,8 @@ loop:
|
|||||||
}
|
}
|
||||||
if(p->to.offset > s->value)
|
if(p->to.offset > s->value)
|
||||||
s->value = p->to.offset;
|
s->value = p->to.offset;
|
||||||
|
if(p->reg & DUPOK)
|
||||||
|
s->dupok = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ADYNT:
|
case ADYNT:
|
||||||
@ -627,10 +629,15 @@ loop:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ADATA:
|
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;
|
s = p->from.sym;
|
||||||
if(s == S) {
|
if(s != S && s->dupok) {
|
||||||
diag("DATA without a sym\n%P", p);
|
if(debug['v'])
|
||||||
break;
|
Bprint(&bso, "skipping %s in %s: dupok\n", s->name, pn);
|
||||||
|
goto loop;
|
||||||
}
|
}
|
||||||
if(s != S) {
|
if(s != S) {
|
||||||
p->dlink = s->data;
|
p->dlink = s->data;
|
||||||
|
@ -561,10 +561,15 @@ find1(int32 l, int c)
|
|||||||
int
|
int
|
||||||
find2(int32 l, int c)
|
find2(int32 l, int c)
|
||||||
{
|
{
|
||||||
|
union {
|
||||||
|
int32 l;
|
||||||
|
short p[2];
|
||||||
|
} u;
|
||||||
short *p;
|
short *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
p = (short*)&l;
|
u.l = l;
|
||||||
|
p = u.p;
|
||||||
for(i=0; i<4; i+=2) {
|
for(i=0; i<4; i+=2) {
|
||||||
if(((*p >> 8) & 0xff) == c)
|
if(((*p >> 8) & 0xff) == c)
|
||||||
return i;
|
return i;
|
||||||
|
@ -22,7 +22,8 @@ TEXT syscall·Syscall(SB),7,$0
|
|||||||
SWI $SYS_syscall
|
SWI $SYS_syscall
|
||||||
MOVW R0, 20(SP) // r1
|
MOVW R0, 20(SP) // r1
|
||||||
MOVW R1, 24(SP) // r2
|
MOVW R1, 24(SP) // r2
|
||||||
MOVW $0, 28(SP) // errno
|
MOVW $0, R0
|
||||||
|
MOVW R0, 28(SP) // errno
|
||||||
BL sys·exitsyscall(SB)
|
BL sys·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@ -40,7 +41,8 @@ TEXT syscall·Syscall6(SB),7,$0
|
|||||||
SWI $SYS_syscall
|
SWI $SYS_syscall
|
||||||
MOVW R0, 32(SP) // r1
|
MOVW R0, 32(SP) // r1
|
||||||
MOVW R1, 36(SP) // r2
|
MOVW R1, 36(SP) // r2
|
||||||
MOVW $0, 40(SP) // errno
|
MOVW $0, R0
|
||||||
|
MOVW R0, 40(SP) // errno
|
||||||
BL sys·exitsyscall(SB)
|
BL sys·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@ -53,5 +55,6 @@ TEXT syscall·RawSyscall(SB),7,$0
|
|||||||
SWI $SYS_syscall
|
SWI $SYS_syscall
|
||||||
MOVW R0, 20(SP) // r1
|
MOVW R0, 20(SP) // r1
|
||||||
MOVW R1, 24(SP) // r2
|
MOVW R1, 24(SP) // r2
|
||||||
MOVW $0, 28(SP) // errno
|
MOVW $0, R0
|
||||||
|
MOVW R0, 28(SP) // errno
|
||||||
RET
|
RET
|
||||||
|
Loading…
Reference in New Issue
Block a user