Mercurial > hg > index.cgi
comparison 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 |
comparison
equal
deleted
inserted
replaced
147:9cf1796259b2 | 148:08fb11004df9 |
---|---|
29 | 29 |
30 #include <lw_alloc.h> | 30 #include <lw_alloc.h> |
31 #include <lw_string.h> | 31 #include <lw_string.h> |
32 | 32 |
33 #include "lwlink.h" | 33 #include "lwlink.h" |
34 | |
35 // the built-in OS9 script | |
36 static char *os9_script = | |
37 "section code load 0000\n" | |
38 "section .text\n" | |
39 "section data\n" | |
40 "section .data\n" | |
41 "section bss,bss load 0000\n" | |
42 "section .bss,bss\n" | |
43 ; | |
34 | 44 |
35 // the built-in DECB target linker script | 45 // the built-in DECB target linker script |
36 static char *decb_script = | 46 static char *decb_script = |
37 "section init load 2000\n" | 47 "section init load 2000\n" |
38 "section code\n" | 48 "section code\n" |
123 break; | 133 break; |
124 | 134 |
125 case OUTPUT_LWEX0: | 135 case OUTPUT_LWEX0: |
126 script = lwex0_script; | 136 script = lwex0_script; |
127 break; | 137 break; |
138 | |
139 case OUTPUT_OS9: | |
140 script = os9_script; | |
141 break; | |
128 | 142 |
129 default: | 143 default: |
130 script = simple_script; | 144 script = simple_script; |
131 break; | 145 break; |
132 } | 146 } |
151 } | 165 } |
152 } | 166 } |
153 | 167 |
154 if (outformat == OUTPUT_LWEX0) | 168 if (outformat == OUTPUT_LWEX0) |
155 linkscript.stacksize = 0x100; | 169 linkscript.stacksize = 0x100; |
170 | |
171 if (outformat == OUTPUT_OS9) | |
172 { | |
173 linkscript.modtype = 0x01; | |
174 linkscript.modlang = 0x01; | |
175 linkscript.modattr = 0x08; | |
176 linkscript.modrev = 0x00; | |
177 linkscript.name = NULL; | |
178 } | |
156 | 179 |
157 oscript = script; | 180 oscript = script; |
158 // now parse the script file | 181 // now parse the script file |
159 while (*script) | 182 while (*script) |
160 { | 183 { |