Added a check for unresolved references
authorceriel <none@none>
Thu, 29 Jan 1987 17:13:37 +0000 (17:13 +0000)
committerceriel <none@none>
Thu, 29 Jan 1987 17:13:37 +0000 (17:13 +0000)
mach/i80/dl/mccpm.c
mach/i80/dl/nascom.c

index 44abdc9..b76f142 100644 (file)
@@ -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);
        }
 
index adf044f..8373fc8 100644 (file)
@@ -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       <stdio.h>
@@ -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);