OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008, Google Inc. | 2 * Copyright 2008, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 char *rest; | 218 char *rest; |
219 struct redir *entry; | 219 struct redir *entry; |
220 struct redir *redir_queue; | 220 struct redir *redir_queue; |
221 struct redir **redir_qend; | 221 struct redir **redir_qend; |
222 | 222 |
223 struct NaClApp state; | 223 struct NaClApp state; |
224 char *nacl_file = 0; | 224 char *nacl_file = 0; |
225 int main_thread_only = 1; | 225 int main_thread_only = 1; |
226 int export_addr_to = -2; | 226 int export_addr_to = -2; |
227 int dump_sock_addr_to = -1; | 227 int dump_sock_addr_to = -1; |
228 enum NaClAbiMismatchOption abi_mismatch_option = | 228 enum NaClAbiCheckOption check_abi = NACL_ABI_CHECK_OPTION_CHECK; |
229 NACL_ABI_MISMATCH_OPTION_ABORT; | |
230 | 229 |
231 struct NaClApp *nap; | 230 struct NaClApp *nap; |
232 | 231 |
233 struct GioFile gout; | 232 struct GioFile gout; |
234 NaClErrorCode errcode; | 233 NaClErrorCode errcode; |
235 struct GioMemoryFileSnapshot gf; | 234 struct GioMemoryFileSnapshot gf; |
236 | 235 |
237 int ret_code; | 236 int ret_code; |
238 /* NOTE: because of windows dll issue this cannot be moved to the top level */ | 237 /* NOTE: because of windows dll issue this cannot be moved to the top level */ |
239 /* @IGNORE_LINES_FOR_CODE_HYGIENE[1] */ | 238 /* @IGNORE_LINES_FOR_CODE_HYGIENE[1] */ |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 return 1; | 327 return 1; |
329 } | 328 } |
330 entry->next = NULL; | 329 entry->next = NULL; |
331 entry->nacl_desc = strtol(optarg, &rest, 0); | 330 entry->nacl_desc = strtol(optarg, &rest, 0); |
332 entry->tag = IMC_DESC; | 331 entry->tag = IMC_DESC; |
333 entry->u.handle = (NaClHandle) strtol(rest+1, (char **) 0, 0); | 332 entry->u.handle = (NaClHandle) strtol(rest+1, (char **) 0, 0); |
334 *redir_qend = entry; | 333 *redir_qend = entry; |
335 redir_qend = &entry->next; | 334 redir_qend = &entry->next; |
336 break; | 335 break; |
337 case 'I': | 336 case 'I': |
338 abi_mismatch_option = NACL_ABI_MISMATCH_OPTION_IGNORE; | 337 check_abi = NACL_ABI_CHECK_OPTION_SKIP; |
339 break; | 338 break; |
340 case 'l': | 339 case 'l': |
341 log_file = optarg; | 340 log_file = optarg; |
342 break; | 341 break; |
343 case 'm': | 342 case 'm': |
344 main_thread_only = 1; | 343 main_thread_only = 1; |
345 break; | 344 break; |
346 case 'M': | 345 case 'M': |
347 main_thread_only = 0; | 346 main_thread_only = 0; |
348 break; | 347 break; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 */ | 442 */ |
444 if (!NaClOsIsSupported()) { | 443 if (!NaClOsIsSupported()) { |
445 errcode = LOAD_UNSUPPORTED_OS_PLATFORM; | 444 errcode = LOAD_UNSUPPORTED_OS_PLATFORM; |
446 nap->module_load_status = errcode; | 445 nap->module_load_status = errcode; |
447 fprintf(stderr, "Error while loading \"%s\": %s\n", | 446 fprintf(stderr, "Error while loading \"%s\": %s\n", |
448 nacl_file, | 447 nacl_file, |
449 NaClErrorString(errcode)); | 448 NaClErrorString(errcode)); |
450 } | 449 } |
451 | 450 |
452 if (LOAD_OK == errcode) { | 451 if (LOAD_OK == errcode) { |
453 errcode = NaClAppLoadFile((struct Gio *) &gf, nap, abi_mismatch_option); | 452 errcode = NaClAppLoadFile((struct Gio *) &gf, nap, check_abi); |
454 if (LOAD_OK != errcode) { | 453 if (LOAD_OK != errcode) { |
455 nap->module_load_status = errcode; | 454 nap->module_load_status = errcode; |
456 fprintf(stderr, "Error while loading \"%s\": %s\n", | 455 fprintf(stderr, "Error while loading \"%s\": %s\n", |
457 nacl_file, | 456 nacl_file, |
458 NaClErrorString(errcode)); | 457 NaClErrorString(errcode)); |
459 } | 458 } |
460 } | 459 } |
461 | 460 |
462 if (LOAD_OK == errcode) { | 461 if (LOAD_OK == errcode) { |
463 if (verbosity) { | 462 if (verbosity) { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 printf("Done.\n"); | 691 printf("Done.\n"); |
693 } | 692 } |
694 fflush(stdout); | 693 fflush(stdout); |
695 | 694 |
696 NaClAllModulesFini(); | 695 NaClAllModulesFini(); |
697 | 696 |
698 WINDOWS_EXCEPTION_CATCH; | 697 WINDOWS_EXCEPTION_CATCH; |
699 | 698 |
700 _exit(ret_code); | 699 _exit(ret_code); |
701 } | 700 } |
OLD | NEW |