diff lwlink/script.c @ 148:08fb11004df9

Initial pass at OS9 module support for lwlink
author lost@l-w.ca
date Fri, 26 Aug 2011 23:26:00 -0600
parents 19df13313b27
children 3b58d76ea032
line wrap: on
line diff
--- a/lwlink/script.c	Thu Aug 25 22:29:58 2011 -0600
+++ b/lwlink/script.c	Fri Aug 26 23:26:00 2011 -0600
@@ -32,6 +32,16 @@
 
 #include "lwlink.h"
 
+// the built-in OS9 script
+static char *os9_script =
+	"section code load 0000\n"
+	"section .text\n"
+	"section data\n"
+	"section .data\n"
+	"section bss,bss load 0000\n"
+	"section .bss,bss\n"
+	;
+
 // the built-in DECB target linker script
 static char *decb_script =
 	"section init load 2000\n"
@@ -125,6 +135,10 @@
 		case OUTPUT_LWEX0:
 			script = lwex0_script;
 			break;
+		
+		case OUTPUT_OS9:
+			script = os9_script;
+			break;
 			
 		default:
 			script = simple_script;
@@ -154,6 +168,15 @@
 	if (outformat == OUTPUT_LWEX0)
 		linkscript.stacksize = 0x100;
 
+	if (outformat == OUTPUT_OS9)
+	{
+		linkscript.modtype = 0x01;
+		linkscript.modlang = 0x01;
+		linkscript.modattr = 0x08;
+		linkscript.modrev = 0x00;
+		linkscript.name = NULL;
+	}
+
 	oscript = script;
 	// now parse the script file
 	while (*script)