]> Shamusworld >> Repos - rmac/blobdiff - object.c
Fix for bug #78: Thanks to ggn for reporting and supplying the patch.
[rmac] / object.c
index 82fc76aa550e59a596461c8c83ba25c1da91de8d..4614c38d66ed373eed028d7f0ed9a849f1282017 100644 (file)
--- a/object.c
+++ b/object.c
@@ -228,13 +228,16 @@ int WriteObject(int fd)
        }
 
        // Write requested object file...
-       switch (obj_format)
-       {
-       case BSD:
+       if ((obj_format == BSD) || ((obj_format == ALCYON) && (prg_flag == 0)))
+    {
+               // Force BSD format from here onwards
+               obj_format = BSD;
+
                if (verb_flag)
                {
                        printf("Total       : %d bytes\n", sect[TEXT].sloc + sect[DATA].sloc + sect[BSS].sloc);
                }
+
                ssize = ((LONG)sy_assign(NULL, NULL));          // Assign index numbers to the symbols
                tds = sect[TEXT].sloc + sect[DATA].sloc;        // Get size of TEXT and DATA segment
                buf = malloc(0x600000);                                         // Allocate 6mb object file image memory
@@ -312,9 +315,9 @@ int WriteObject(int fd)
                if (buf)
                        free(buf);                                      // Free allocated memory
 
-               break;
-
-       case ALCYON:
+    }
+    else if (obj_format==ALCYON)
+    {
                if (verb_flag)
                {
                        if (prg_flag)
@@ -400,7 +403,6 @@ int WriteObject(int fd)
                 */
                tds = markimg(buf, tds, sect[TEXT].sloc, 1);
                write(fd, buf, tds);
-               break;
        }
 
        return 0;