.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
/*
- * $Source$
- * $State$
- *
* Simple tool to produce an utterly basic ELF executable
* from an absolute ack.out file. Suitable for operating
* systems like Linux.
#include <stdio.h>
#include <stdarg.h>
#include <stdint.h>
+#include <stdbool.h>
#include <string.h>
#include <inttypes.h>
#include "out.h"
char hdr[HDR_LENGTH] ;
+bool verbose = false;
+
/* Segment numbers understood by aelflod. */
enum {
elfmachine = atoi(&argv[1][2]);
break;
+ case 'v':
+ verbose = true;
+ break;
+
default:
syntaxerror:
fatal("syntax error --- try -h for help");
/* 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);
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;
.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
* 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>
char hdr[HDR_LENGTH] ;
+bool verbose = false;
+
/* Segment numbers understood by aslod. */
enum {
program);
exit(0);
+ case 'v':
+ verbose = true;
+ break;
+
default:
syntaxerror:
fatal("syntax error --- try -h for help");
/* 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);
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;