Commit 75c918c1 authored by Lucio De Re's avatar Lucio De Re Committed by Russ Cox

ld: fix build on Plan 9

ld/data.c:
. Format specifier with corresponding cast to cater for all
  architectures (llux and vlong).

ld/ldelf.c:
ld/ldmacho.c:
. Missing "pn" argument in diag() calls.

ld/ldpe.c:
. Dropped "sym->sectnum" in diag() call.
. Typo in a comment.

ld/lib.h:
. Added varargck pragma for "O".

R=rsc
CC=golang-dev
https://golang.org/cl/4749042
parent eb3f2083
......@@ -512,7 +512,7 @@ codeblk(int32 addr, int32 size)
epc = p->link->pc;
else
epc = sym->value + sym->size;
Bprint(&bso, "%.6ux\t", p->pc);
Bprint(&bso, "%.6llux\t", (uvlong)p->pc);
q = sym->p + p->pc - sym->value;
n = epc - p->pc;
Bprint(&bso, "%-20.*I | %P\n", (int)n, q, p);
......
......@@ -398,13 +398,13 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn)
goto bad;
if(e->e16(hdr->type) != ElfTypeRelocatable) {
diag("%s: elf but not elf relocatable object");
diag("%s: elf but not elf relocatable object", pn);
return;
}
switch(thechar) {
default:
diag("%s: elf %s unimplemented", thestring);
diag("%s: elf %s unimplemented", pn, thestring);
return;
case '5':
if(e != &le || obj->machine != ElfMachArm || hdr->ident[4] != ElfClass32) {
......
......@@ -480,7 +480,7 @@ ldmacho(Biobuf *f, char *pkg, int64 len, char *pn)
switch(thechar) {
default:
diag("%s: mach-o %s unimplemented", thestring);
diag("%s: mach-o %s unimplemented", pn, thestring);
return;
case '6':
if(e != &le || m->cputype != MachoCpuAmd64) {
......
......@@ -338,7 +338,7 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn)
if(sect->sym == 0)
diag("%s: %s sym == 0!", pn, s->name);
} else {
diag("%s: %s sectnum <0!", pn, s->name, sym->sectnum);
diag("%s: %s sectnum < 0!", pn, s->name);
}
if(sect == nil)
......@@ -383,7 +383,7 @@ map(PeObj *obj, PeSect *sect)
return 0;
sect->base = mal(sect->sh.SizeOfRawData);
if(sect->sh.PointerToRawData == 0) // .bss don't has data in object file.
if(sect->sh.PointerToRawData == 0) // .bss doesn't have data in object file
return 0;
werrstr("short read");
if(Bseek(obj->f, obj->base+sect->sh.PointerToRawData, 0) < 0 ||
......
......@@ -277,6 +277,8 @@ extern Header headers[];
int headtype(char*);
int Yconv(Fmt*);
#pragma varargck type "O" int
#pragma varargck type "Y" Sym*
// buffered output
......
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