aelflod and aslod now default to not showing the memory dump. dtrg-cgen
authorDavid Given <dg@cowlark.com>
Sun, 13 Nov 2016 19:50:23 +0000 (20:50 +0100)
committerDavid Given <dg@cowlark.com>
Sun, 13 Nov 2016 19:50:23 +0000 (20:50 +0100)
util/amisc/aelflod.1
util/amisc/aelflod.c
util/amisc/aslod.1
util/amisc/aslod.c

index 6e22d53..24001ba 100644 (file)
@@ -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
index 398b223..e3692ac 100644 (file)
@@ -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 <stdio.h>
 #include <stdarg.h>
 #include <stdint.h>
+#include <stdbool.h>
 #include <string.h>
 #include <inttypes.h>
 #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;
index 7e29183..a786b13 100644 (file)
@@ -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
index 307f72c..afc8f8c 100644 (file)
  * CVS...)
  * 
  * dtrg, 2006-10-17
- * 
- * $Source$
- * $State$
  */
 
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdarg.h>
+#include <stdbool.h>
 #include <string.h>
 #include <inttypes.h>
 #include <unistd.h>
@@ -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;