summaryrefslogtreecommitdiffstats
path: root/arch/arm/boot
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-05-07 03:14:42 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-05-07 03:14:42 +0000
commitdca50cc150304946afb790f00ead222736146e3e (patch)
treebdab0fb75bde086403c66b8769c0333262cb0635 /arch/arm/boot
parentdcec8a13bf565e47942a1751a9cec21bec5648fe (diff)
Toxic waste.
Diffstat (limited to 'arch/arm/boot')
-rw-r--r--arch/arm/boot/tools/build.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/arch/arm/boot/tools/build.c b/arch/arm/boot/tools/build.c
deleted file mode 100644
index ac1297564..000000000
--- a/arch/arm/boot/tools/build.c
+++ /dev/null
@@ -1,70 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <a.out.h>
-
-typedef unsigned char byte;
-typedef unsigned short word;
-typedef unsigned long u32;
-
-void die(const char * str, ...)
-{
- va_list args;
- va_start(args, str);
- vfprintf(stderr, str, args);
- fputc('\n', stderr);
- exit (1);
-}
-
-int main(int argc, char **argv)
-{
- void *data;
- struct exec ex;
- FILE *f;
- int totlen;
-
- if (argc < 2) {
- fprintf(stderr, "Usage: build kernel-name\n");
- exit(1);
- }
-
- f = fopen(argv[1], "rb");
- if (!f)
- die("Unable to open `%s': %m", argv[1]);
-
- fread(&ex, 1, sizeof(ex), f);
-
- if(N_MAGIC(ex) == ZMAGIC) {
- fseek(f, 4096, SEEK_SET);
- totlen = ex.a_text + ex.a_data;
- } else
- if(N_MAGIC(ex) == QMAGIC) {
- unsigned long my_header;
-
- fseek(f, 4, SEEK_SET);
-
- my_header = 0xea000006;
-
- fwrite(&my_header, 4, 1, stdout);
-
- totlen = ex.a_text + ex.a_data - 4;
- } else {
- fprintf(stderr, "Unacceptable a.out header on kernel\n");
- fclose(f);
- exit(1);
- }
-
- fprintf(stderr, "Kernel is %dk (%dk text, %dk data, %dk bss)\n",
- (ex.a_text + ex.a_data + ex.a_bss)/1024,
- ex.a_text/1024, ex.a_data/1024, ex.a_bss/1024);
-
- data = malloc(totlen);
- fread(data, 1, totlen, f);
- fwrite(data, 1, totlen, stdout);
-
- free(data);
- fclose(f);
- fflush(stdout);
- return 0;
-}