diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1998-07-29 00:36:04 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1998-07-29 00:36:04 +0000 |
commit | 7c648d84b3e2cc41ad10b0939497c02508ca314f (patch) | |
tree | 4586ce8abf3e21f04c055dfd3bb140ba63f9277e /sys | |
parent | 4ac827a9cbde07dac95781c9d3a188a8ed673ae3 (diff) |
if() debug prints; correct handling sym-less files
Diffstat (limited to 'sys')
-rw-r--r-- | sys/lib/libsa/exec.new.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/lib/libsa/exec.new.c b/sys/lib/libsa/exec.new.c index d2bc31849e3..e0eb12d9b76 100644 --- a/sys/lib/libsa/exec.new.c +++ b/sys/lib/libsa/exec.new.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.new.c,v 1.2 1998/07/20 18:12:34 mickey Exp $ */ +/* $OpenBSD: exec.new.c,v 1.3 1998/07/29 00:36:03 mickey Exp $ */ /* * Copyright (c) 1998 Michael Shalayeff @@ -38,6 +38,8 @@ #include "libsa.h" #include <lib/libsa/exec.h> +extern int debug; + void exec(path, loadaddr, howto) char *path; @@ -77,14 +79,15 @@ exec(path, loadaddr, howto) goto err; } #ifdef EXEC_DEBUG - printf("ep=%x, end=%x\n.text=%x,%u,%u\n.data=%x,%u,%u\n" - ".bss=%x,%u,%u\n.sym=%x,%u,%u\n.str=%x,%u,%u\n", - param.xp_entry, param.xp_end, - param.text.addr, param.text.size, param.text.foff, - param.data.addr, param.data.size, param.data.foff, - param.bss.addr, param.bss.size, param.bss.foff, - param.sym.addr, param.sym.size, param.sym.foff, - param.str.addr, param.str.size, param.str.foff); + if (debug) + printf("ep=%x, end=%x\n.text=%x,%u,%u\n.data=%x,%u,%u\n" + ".bss=%x,%u,%u\n.sym=%x,%u,%u\n.str=%x,%u,%u\n", + param.xp_entry, param.xp_end, + param.text.addr, param.text.size, param.text.foff, + param.data.addr, param.data.size, param.data.foff, + param.bss.addr, param.bss.size, param.bss.foff, + param.sym.addr, param.sym.size, param.sym.foff, + param.str.addr, param.str.size, param.str.foff); #endif pa = loadaddr; @@ -105,7 +108,7 @@ exec(path, loadaddr, howto) printf("+%u", param.bss.size); bzero (pa + param.bss.addr, param.bss.size); - sz = 0; + sz = param.bss.addr + param.bss.size; if (param.sym.size) { printf("+[%u", param.sym.size); if (lseek(fd, param.sym.foff, SEEK_SET) <= 0 || |