OLD | NEW |
1 // Inferno utils/8l/obj.c | 1 // Inferno utils/8l/obj.c |
2 // http://code.google.com/p/inferno-os/source/browse/utils/8l/obj.c | 2 // http://code.google.com/p/inferno-os/source/browse/utils/8l/obj.c |
3 // | 3 // |
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. | 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. |
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) | 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) |
6 // Portions Copyright © 1997-1999 Vita Nuova Limited | 6 // Portions Copyright © 1997-1999 Vita Nuova Limited |
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) | 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) |
8 // Portions Copyright © 2004,2006 Bruce Ellis | 8 // Portions Copyright © 2004,2006 Bruce Ellis |
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) | 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) |
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others | 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 else | 158 else |
159 if(strcmp(goos, "nacl") == 0) | 159 if(strcmp(goos, "nacl") == 0) |
160 HEADTYPE = 8; | 160 HEADTYPE = 8; |
161 else | 161 else |
162 if(strcmp(goos, "freebsd") == 0) | 162 if(strcmp(goos, "freebsd") == 0) |
163 HEADTYPE = 9; | 163 HEADTYPE = 9; |
164 else | 164 else |
165 if(strcmp(goos, "mingw") == 0) | 165 if(strcmp(goos, "mingw") == 0) |
166 HEADTYPE = 10; | 166 HEADTYPE = 10; |
167 else | 167 else |
| 168 if(strcmp(goos, "pchw") == 0) |
| 169 HEADTYPE = 11; |
| 170 else |
168 print("goos is not known: %s\n", goos); | 171 print("goos is not known: %s\n", goos); |
169 } | 172 } |
170 | 173 |
171 if(outfile == nil) { | 174 if(outfile == nil) { |
172 if(HEADTYPE == 10) | 175 if(HEADTYPE == 10) |
173 outfile = "8.out.exe"; | 176 outfile = "8.out.exe"; |
174 else | 177 else |
175 outfile = "8.out"; | 178 outfile = "8.out"; |
176 } | 179 } |
177 | 180 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 case 10: /* PE executable */ | 279 case 10: /* PE executable */ |
277 peinit(); | 280 peinit(); |
278 HEADR = PERESERVE; | 281 HEADR = PERESERVE; |
279 if(INITTEXT == -1) | 282 if(INITTEXT == -1) |
280 INITTEXT = PEBASE+0x1000; | 283 INITTEXT = PEBASE+0x1000; |
281 if(INITDAT == -1) | 284 if(INITDAT == -1) |
282 INITDAT = 0; | 285 INITDAT = 0; |
283 if(INITRND == -1) | 286 if(INITRND == -1) |
284 INITRND = PEALIGN; | 287 INITRND = PEALIGN; |
285 break; | 288 break; |
| 289 case 11: |
| 290 tlsoffset = 0; |
| 291 elfinit(); |
| 292 HEADR = ELFRESERVE; |
| 293 if(INITTEXT == -1) |
| 294 INITTEXT = 0x100000+HEADR; |
| 295 if(INITDAT == -1) |
| 296 INITDAT = 0; |
| 297 if(INITRND == -1) |
| 298 INITRND = 4096; |
| 299 break; |
286 } | 300 } |
287 if(INITDAT != 0 && INITRND != 0) | 301 if(INITDAT != 0 && INITRND != 0) |
288 print("warning: -D0x%lux is ignored because of -R0x%lux\n", | 302 print("warning: -D0x%lux is ignored because of -R0x%lux\n", |
289 INITDAT, INITRND); | 303 INITDAT, INITRND); |
290 if(debug['v']) | 304 if(debug['v']) |
291 Bprint(&bso, "HEADER = -H0x%ld -T0x%lux -D0x%lux -R0x%lux\n", | 305 Bprint(&bso, "HEADER = -H0x%ld -T0x%lux -D0x%lux -R0x%lux\n", |
292 HEADTYPE, INITTEXT, INITDAT, INITRND); | 306 HEADTYPE, INITTEXT, INITDAT, INITRND); |
293 Bflush(&bso); | 307 Bflush(&bso); |
294 for(i=1; optab[i].as; i++) | 308 for(i=1; optab[i].as; i++) |
295 if(i != optab[i].as) { | 309 if(i != optab[i].as) { |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 p->to.type = D_BRANCH; | 1038 p->to.type = D_BRANCH; |
1025 p->pcond = ps4; | 1039 p->pcond = ps4; |
1026 p->to.sym = s4; | 1040 p->to.sym = s4; |
1027 | 1041 |
1028 p = q; | 1042 p = q; |
1029 | 1043 |
1030 continue; | 1044 continue; |
1031 } | 1045 } |
1032 } | 1046 } |
1033 } | 1047 } |
OLD | NEW |