Fix last few undefined symbols in generated executable
authorNick Downing <nick@ndcode.org>
Fri, 12 Aug 2022 06:05:05 +0000 (16:05 +1000)
committerNick Downing <nick@ndcode.org>
Fri, 12 Aug 2022 06:05:05 +0000 (16:05 +1000)
usr/src/cmd/c/c11.c
usr/src/cmd/c/c20.c
usr/src/libc/sys/sbrk.s

index 8958b88..05d7658 100644 (file)
@@ -873,7 +873,7 @@ getree()
  fprintf(stderr, "CSPACE\n");
 #endif
                t = outname(s);
-               printf(".bank   D\n.area        comm_%.8s (rel,ovr,bank = D)\n%.8s:.ds  %d\n.area       %s\n", t, t, geti(), area);
+               printf(".globl  %8.s\n.bank     D\n.area        comm_%.8s (rel,ovr,bank = D)\n%.8s:.ds  %d\n.area       %s\n", t, t, t, geti(), area);
                break;
 
        case SSPACE:
index 817dc70..2fe478b 100644 (file)
@@ -525,7 +525,7 @@ iterate()
                if (p->op==JBR || p->op==JMP) {
                        while (p->forw && p->forw->op!=LABEL
                                && p->forw->op!=DLABEL
-                               && p->forw->op!=EROU && p->forw->op!=END
+                               && p->forw->op!=GLOBL/*EROU*/ && p->forw->op!=END
                                && p->forw->op!=0 && p->forw->op!=DATA) {
                                nchange++;
                                iaftbr++;
index 79f19e3..c3535f8 100644 (file)
@@ -4,8 +4,11 @@
 ;sbrk gets increment more core, and returns a pointer
 ;      to the beginning of the new core area
 ;
+
+; note: _end symbol changed to e_D for aslink (end of bank D)
+
 .globl _sbrk, _brk
-.globl _end, cerror
+.globl e_D, cerror
 .break = 17
 
 _sbrk:
@@ -46,4 +49,4 @@ _3:
 _2:
        sys     .break
 _0:.dw 0 ;..
-nd:    .dw     _end
+nd:    .dw     e_D