mirror of
https://github.com/golang/go
synced 2024-11-20 05:04:43 -07:00
fix undefined function error.
before: mainstart: undefined: main·init in mainstart mainstart: branch out of range in mainstart (95) CALL ,0(PC) [main·init] mainstart: undefined: main·main in mainstart mainstart: branch out of range in mainstart (97) CALL ,0(PC) [main·main] mainstart: doasm: notfound from=6f to=6f (95) CALL , mainstart: doasm: notfound from=6f to=6f (97) CALL , mainstart: doasm: notfound from=6f to=6f (95) CALL , mainstart: doasm: notfound from=6f to=6f (97) CALL , mainstart: doasm: notfound from=6f to=6f (95) CALL , mainstart: doasm: notfound from=6f to=6f (97) CALL , after: mainstart: undefined: main·init in mainstart mainstart: undefined: main·main in mainstart R=r DELTA=7 (1 added, 0 deleted, 6 changed) OCL=31555 CL=31555
This commit is contained in:
parent
8afc6008a8
commit
29e93590b0
@ -343,10 +343,10 @@ patch(void)
|
||||
s = p->to.sym;
|
||||
switch(s->type) {
|
||||
default:
|
||||
diag("undefined: %s\n%P", s->name, p);
|
||||
diag("undefined: %s", s->name);
|
||||
s->type = STEXT;
|
||||
s->value = vexit;
|
||||
break;
|
||||
continue; // avoid more error messages
|
||||
case STEXT:
|
||||
p->to.offset = s->value;
|
||||
p->to.type = D_BRANCH;
|
||||
@ -559,7 +559,7 @@ reachable()
|
||||
if(p == nil)
|
||||
return;
|
||||
s = p->from.sym;
|
||||
}
|
||||
}
|
||||
s->used = 1;
|
||||
do{
|
||||
todo = 0;
|
||||
@ -771,7 +771,7 @@ ckuse(Sym *s, Sym *s0, Use *u)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
setuse(Sym *s, Sym *s0, Use *u)
|
||||
{
|
||||
@ -786,7 +786,7 @@ setuse(Sym *s, Sym *s0, Use *u)
|
||||
setfpuse(u->p, s0, s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* detect BX O(R) which can be done as BL O(R) */
|
||||
void
|
||||
fnptrs()
|
||||
@ -795,14 +795,14 @@ fnptrs()
|
||||
Sym *s;
|
||||
Prog *p;
|
||||
Use *u;
|
||||
|
||||
|
||||
for(i=0; i<NHASH; i++){
|
||||
for(s = hash[i]; s != S; s = s->link){
|
||||
if(s->fnptr && (s->type == STEXT || s->type == SLEAF || s->type == SCONST)){
|
||||
// print("%s : fnptr %d %d\n", s->name, s->thumb, s->foreign);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* record use of syms */
|
||||
for(p = firstp; p != P; p = p->link){
|
||||
if(p->as == ATEXT)
|
||||
@ -827,7 +827,7 @@ fnptrs()
|
||||
for(u = s->use; u != U; u = u->link)
|
||||
setuse(s, s, u);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -377,10 +377,11 @@ patch(void)
|
||||
Bprint(&bso, "%s calls %s\n", TNAME, s->name);
|
||||
switch(s->type) {
|
||||
default:
|
||||
diag("undefined: %s in %s", s->name, TNAME);
|
||||
/* diag prints TNAME first */
|
||||
diag("undefined: %s", s->name);
|
||||
s->type = STEXT;
|
||||
s->value = vexit;
|
||||
break; /* or fall through to set offset? */
|
||||
continue; // avoid more error messages
|
||||
case STEXT:
|
||||
p->to.offset = s->value;
|
||||
break;
|
||||
|
@ -346,10 +346,10 @@ patch(void)
|
||||
switch(s->type) {
|
||||
default:
|
||||
/* diag prints TNAME first */
|
||||
diag("%s is undefined", s->name);
|
||||
diag("undefined: %s", s->name);
|
||||
s->type = STEXT;
|
||||
s->value = vexit;
|
||||
break; /* or fall through to set offset? */
|
||||
continue; // avoid more error messages
|
||||
case STEXT:
|
||||
p->to.offset = s->value;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user