Commit fa4a9ff7 authored by Russ Cox's avatar Russ Cox

cmd/ld, runtime: clean up CL 9666047

Remove unnecessary ( ) around == in && clause.
Add { } around multiline if body, even though it's one statement.

Add runtime: prefix to printed errors.

R=cshapiro, iant
CC=golang-dev
https://golang.org/cl/9685047
parent 59fb90ac
......@@ -1914,13 +1914,13 @@ genasmsym(void (*put)(Sym*, char*, int, vlong, vlong, int, Sym*))
/* frame, locals, args, auto, param and pointers after */
put(nil, ".frame", 'm', (uint32)s->text->to.offset+PtrSize, 0, 0, 0);
put(nil, ".locals", 'm', s->locals, 0, 0, 0);
if((s->text->textflag & NOSPLIT) && (s->args == 0) && (s->nptrs < 0))
if((s->text->textflag & NOSPLIT) && s->args == 0 && s->nptrs < 0) {
// This might be a vararg function and have no
// predetermined argument size. This check is
// approximate and will also match 0 argument
// nosplit functions compiled by 6c.
put(nil, ".args", 'm', ArgsSizeUnknown, 0, 0, 0);
else
} else
put(nil, ".args", 'm', s->args, 0, 0, 0);
if(s->nptrs >= 0) {
put(nil, ".nptrs", 'm', s->nptrs, 0, 0, 0);
......
......@@ -204,7 +204,7 @@ dofunc(Sym *sym)
if(runtime·strcmp(sym->name, (byte*)"etext") == 0)
break;
if(sym->value < lastvalue) {
runtime·printf("symbols out of order: %p before %p\n", lastvalue, sym->value);
runtime·printf("runtime: symbols out of order: %p before %p\n", lastvalue, sym->value);
runtime·throw("malformed symbol table");
}
lastvalue = sym->value;
......@@ -230,7 +230,7 @@ dofunc(Sym *sym)
else if(runtime·strcmp(sym->name, (byte*)".nptrs") == 0) {
// TODO(cshapiro): use a dense representation for gc information
if(sym->value != func[nfunc-1].args/sizeof(uintptr)) {
runtime·printf("pointer map size and argument size disagree\n");
runtime·printf("runtime: pointer map size and argument size disagree\n");
runtime·throw("mangled symbol table");
}
cap = ROUND(sym->value, 32) / 32;
......@@ -239,12 +239,12 @@ dofunc(Sym *sym)
func[nfunc-1].ptrs.cap = cap;
} else if(runtime·strcmp(sym->name, (byte*)".ptrs") == 0) {
if(func[nfunc-1].ptrs.len >= func[nfunc-1].ptrs.cap) {
runtime·printf("more pointer map entries read than argument words\n");
runtime·printf("runtime: more pointer map entries read than argument words\n");
runtime·throw("mangled symbol table");
}
((uint32*)func[nfunc-1].ptrs.array)[func[nfunc-1].ptrs.len++] = sym->value;
} else {
runtime·printf("invalid '%c' symbol named '%s'\n", (int8)sym->symtype, sym->name);
runtime·printf("runtime: invalid '%c' symbol named '%s'\n", (int8)sym->symtype, sym->name);
runtime·throw("mangled symbol table");
}
break;
......
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