From bfb89ae93751fc7803fb514ac0c594dfffa1fa92 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 29 Jan 1987 17:13:37 +0000 Subject: [PATCH] Added a check for unresolved references --- mach/i80/dl/mccpm.c | 6 +++++- mach/i80/dl/nascom.c | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mach/i80/dl/mccpm.c b/mach/i80/dl/mccpm.c index 44abdc99a..b76f142d5 100644 --- a/mach/i80/dl/mccpm.c +++ b/mach/i80/dl/mccpm.c @@ -41,6 +41,9 @@ convert () int i; rd_ohead(&head); + if (head.oh_flags & HF_LINK) { + fatal("%s contains unresolved references\n",s); + } rd_sect(sect, head.oh_nsect); for (i = 0; i < head.oh_nsect; i++) { rd_outsect(i); @@ -107,8 +110,9 @@ int b; } fatal (s,a) + char *s, *a; { - printf (s,a); + fprintf (stderr,s,a); exit (-1); } diff --git a/mach/i80/dl/nascom.c b/mach/i80/dl/nascom.c index adf044fb8..8373fc8e1 100644 --- a/mach/i80/dl/nascom.c +++ b/mach/i80/dl/nascom.c @@ -2,6 +2,7 @@ * Download Z80 load module into the NASCOM * * Johan Stevenson, Vrije Universiteit, Amsterdam + * Adapted (untested) to new ack.out format by * Ceriel Jacobs, Vrije Universiteit, Amsterdam */ #include @@ -63,11 +64,11 @@ main(argc,argv) char **argv; { if (argc == 2) s = argv[1]; else if (argc != 1) { - fprintf(stderr,"usage: %s [flags] [object file]\n",argv[0]); + fprintf(stderr,"usage: %s [flags] [object file]\n",progname); stop(-1); } if (! rd_open(s)) { - fprintf(stderr,"%s: can't open %s\n",argv[0],s); + fprintf(stderr,"%s: can't open %s\n",progname,s); stop(-1); } if (nascom) { @@ -88,6 +89,10 @@ main(argc,argv) char **argv; { sleep(5); } rd_ohead(&ohead); + if (ohead.oh_flags & HF_LINK) { + fprintf(stderr,"%s: %s contains unresolved references\n",progname,s); + stop(-1); + } rd_sect(sect, ohead.oh_nsect); for (i = 0; i < ohead.oh_nsect; i++) { rd_outsect(i);