diff --git a/util/amisc/aelflod.1 b/util/amisc/aelflod.1 index 6e22d53d2..24001ba2d 100644 --- a/util/amisc/aelflod.1 +++ b/util/amisc/aelflod.1 @@ -2,7 +2,7 @@ .SH NAME aelflod \- ACK ELF loader .SH SYNOPSIS -aelflod [-h] inputfile outputfile +aelflod [-h] [-v] inputfile outputfile .SH DESCRIPTION .I aelflod converts an absolute ack.out file into a simple binary memory diff --git a/util/amisc/aelflod.c b/util/amisc/aelflod.c index 398b223b2..e3692ac01 100644 --- a/util/amisc/aelflod.c +++ b/util/amisc/aelflod.c @@ -1,7 +1,4 @@ /* - * $Source$ - * $State$ - * * Simple tool to produce an utterly basic ELF executable * from an absolute ack.out file. Suitable for operating * systems like Linux. @@ -24,6 +21,7 @@ #include #include #include +#include #include #include #include "out.h" @@ -68,6 +66,8 @@ const char elf_le_ident_string[] = { char hdr[HDR_LENGTH] ; +bool verbose = false; + /* Segment numbers understood by aelflod. */ enum { @@ -299,6 +299,10 @@ int main(int argc, char* argv[]) elfmachine = atoi(&argv[1][2]); break; + case 'v': + verbose = true; + break; + default: syntaxerror: fatal("syntax error --- try -h for help"); @@ -451,8 +455,9 @@ int main(int argc, char* argv[]) /* Summarise what we've done. */ + if (verbose) { - long ss = 0; + uint32_t ss = 0; printf(" address length\n"); printf(" ehdr : %08"PRIx32" %08"PRIx32"\n", outsect[TEXT].os_base & ~0x1FFF, codeoffset); printf(" text : %08"PRIx32" %08"PRIx32"\n", outsect[TEXT].os_base, outsect[TEXT].os_size); @@ -463,7 +468,7 @@ int main(int argc, char* argv[]) ss += outsect[ROM].os_size; ss += outsect[DATA].os_size; ss += outsect[BSS].os_size; - printf("TOTAL : %08lX\n", ss); + printf("TOTAL : %08"PRIx32"\n", ss); } return 0; diff --git a/util/amisc/aslod.1 b/util/amisc/aslod.1 index 7e291838f..a786b13e6 100644 --- a/util/amisc/aslod.1 +++ b/util/amisc/aslod.1 @@ -2,7 +2,7 @@ .SH NAME aslod \- ACK simple loader .SH SYNOPSIS -aslod [-h] inputfile outputfile +aslod [-h] [-v] inputfile outputfile .SH DESCRIPTION .I aslod converts an absolute ack.out file into a simple binary memory diff --git a/util/amisc/aslod.c b/util/amisc/aslod.c index 307f72cb1..afc8f8c3e 100644 --- a/util/amisc/aslod.c +++ b/util/amisc/aslod.c @@ -14,14 +14,12 @@ * CVS...) * * dtrg, 2006-10-17 - * - * $Source$ - * $State$ */ #include #include #include +#include #include #include #include @@ -53,6 +51,8 @@ FILE* output; /* Output stream */ char hdr[HDR_LENGTH] ; +bool verbose = false; + /* Segment numbers understood by aslod. */ enum { @@ -206,6 +206,10 @@ int main(int argc, char* argv[]) program); exit(0); + case 'v': + verbose = true; + break; + default: syntaxerror: fatal("syntax error --- try -h for help"); @@ -301,8 +305,9 @@ int main(int argc, char* argv[]) /* Summarise what we've done. */ + if (verbose) { - long ss = 0; + uint32_t ss = 0; printf(" base : %08"PRIx32"\n", outsect[TEXT].os_base) ; printf(" text = %08"PRIx32"\n", outsect[TEXT].os_size); printf(" rom = %08"PRIx32"\n", outsect[ROM].os_size); @@ -312,7 +317,7 @@ int main(int argc, char* argv[]) ss += outsect[ROM].os_size; ss += outsect[DATA].os_size; ss += outsect[BSS].os_size; - printf("TOTAL = %08lX\n", ss); + printf("TOTAL = %08"PRIx32"\n", ss); } return 0;