bankld: support banked linking of non common area data
authorAlan Cox <alan@linux.intel.com>
Mon, 2 Jul 2018 21:17:31 +0000 (22:17 +0100)
committerAlan Cox <alan@linux.intel.com>
Mon, 2 Jul 2018 21:17:31 +0000 (22:17 +0100)
We need this to put things like the vt buffer into a specific bank rather
than common space on TRS80 model 1

Kernel/tools/bankld/lkrloc3.c
Kernel/tools/binmunge.c

index 98c862c..f2f8ee4 100644 (file)
@@ -187,9 +187,9 @@ static int bankmagic(struct areax *ax)
                 return 1;
         if (strcmp(a->a_id, "_DISCARD2") == 0)
                 return 2;
-        if (strncmp(a->a_id, "_CODE", 5))
+        if (strncmp(a->a_id, "_CODE", 5) && strncmp(a->a_id, "_DATA", 5))
                 return 0;
-        if (a->a_id[5] == 0)   /* We count _CODE and _CODE1 both as first bank */
+        if (a->a_id[0] == 'C' && a->a_id[5] == 0)      /* We count _CODE and _CODE1 both as first bank */
                 return 1;
         c = a->a_id[5] - '0';
         if (c < 1 || c > 9)
index 4ddc512..72feb30 100644 (file)
@@ -226,7 +226,7 @@ int stub_code(char *name)
   /* Data */
   if(strcmp(name, "_INITIALIZER") == 0)
     return 0;
-  if(strcmp(name, "_DATA") == 0)
+  if(strncmp(name, "_DATA", 5) == 0)
     return 0;
   if(strcmp(name, "_FONT") == 0)
     return 0;