OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /* | 7 /* |
8 * NaCl Simple/secure ELF loader (NaCl SEL). | 8 * NaCl Simple/secure ELF loader (NaCl SEL). |
9 */ | 9 */ |
10 #include "native_client/src/include/portability.h" | 10 #include "native_client/src/include/portability.h" |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
671 fprintf(stderr, "NaClAppPrepareToLaunch returned %d", errcode); | 671 fprintf(stderr, "NaClAppPrepareToLaunch returned %d", errcode); |
672 } | 672 } |
673 NaClPerfCounterMark(&time_all_main, "AppPrepLaunch"); | 673 NaClPerfCounterMark(&time_all_main, "AppPrepLaunch"); |
674 NaClPerfCounterIntervalLast(&time_all_main); | 674 NaClPerfCounterIntervalLast(&time_all_main); |
675 } | 675 } |
676 | 676 |
677 /* Give debuggers a well known point at which xlate_base is known. */ | 677 /* Give debuggers a well known point at which xlate_base is known. */ |
678 NaClGdbHook(&state); | 678 NaClGdbHook(&state); |
679 } | 679 } |
680 | 680 |
681 | |
682 if (NULL != blob_library_file) { | 681 if (NULL != blob_library_file) { |
683 if (LOAD_OK == errcode) { | 682 if (LOAD_OK == errcode) { |
684 NaClLog(2, "Loading blob file %s\n", blob_library_file); | 683 if (NULL != nap->text_shm) { |
685 errcode = NaClAppLoadFileDynamically(nap, (struct Gio *) &blob_file); | 684 NaClLog(2, "Loading blob file %s\n", blob_library_file); |
686 if (LOAD_OK != errcode) { | 685 errcode = NaClAppLoadFileDynamically(nap, (struct Gio *) &blob_file); |
687 fprintf(stderr, "Error while loading \"%s\": %s\n", | 686 if (LOAD_OK != errcode) { |
688 blob_library_file, | 687 fprintf(stderr, "Error while loading \"%s\": %s\n", |
689 NaClErrorString(errcode)); | 688 blob_library_file, |
689 NaClErrorString(errcode)); | |
690 } | |
691 NaClPerfCounterMark(&time_all_main, "BlobLoaded"); | |
692 NaClPerfCounterIntervalLast(&time_all_main); | |
693 } else { | |
694 /* | |
695 * TODO(mseaborn): Omit -B when the IRT is not wanted (e.g., from | |
696 * sel_ldr_launcher_standalone), instead of looking for the absence | |
697 * of a segment gap, to provide better diagnostics when the linker | |
Mark Seaborn
2012/06/28 22:50:55
maybe: "when the nexe does not follow NaCl's stabl
jvoung - send to chromium...
2012/06/28 23:02:50
Done.
| |
698 * did not create a segment gap! | |
699 */ | |
700 NaClLog(LOG_WARNING, | |
701 "Main executable has no segment gap; not loading IRT library.\n" | |
Mark Seaborn
2012/06/28 22:50:55
Can you keep the warning all on one line, please?
jvoung - send to chromium...
2012/06/28 23:02:50
Done.
| |
702 "This is expected for PNaCl's translator nexes.\n"); | |
690 } | 703 } |
691 NaClPerfCounterMark(&time_all_main, "BlobLoaded"); | |
692 NaClPerfCounterIntervalLast(&time_all_main); | |
693 } | 704 } |
694 | 705 |
695 if (-1 == (*((struct Gio *) &blob_file)->vtbl->Close)((struct Gio *) | 706 if (-1 == (*((struct Gio *) &blob_file)->vtbl->Close)((struct Gio *) |
696 &blob_file)) { | 707 &blob_file)) { |
697 fprintf(stderr, "Error while closing \"%s\".\n", blob_library_file); | 708 fprintf(stderr, "Error while closing \"%s\".\n", blob_library_file); |
698 } | 709 } |
699 (*((struct Gio *) &blob_file)->vtbl->Dtor)((struct Gio *) &blob_file); | 710 (*((struct Gio *) &blob_file)->vtbl->Dtor)((struct Gio *) &blob_file); |
700 if (verbosity) { | 711 if (verbosity) { |
701 gprintf((struct Gio *) &gout, "printing post-IRT NaClApp details\n"); | 712 gprintf((struct Gio *) &gout, "printing post-IRT NaClApp details\n"); |
702 NaClAppPrintDetails(nap, (struct Gio *) &gout); | 713 NaClAppPrintDetails(nap, (struct Gio *) &gout); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
873 fflush(stdout); | 884 fflush(stdout); |
874 | 885 |
875 if (handle_signals) NaClSignalHandlerFini(); | 886 if (handle_signals) NaClSignalHandlerFini(); |
876 NaClAllModulesFini(); | 887 NaClAllModulesFini(); |
877 | 888 |
878 NaClExit(ret_code); | 889 NaClExit(ret_code); |
879 | 890 |
880 /* Unreachable, but having the return prevents a compiler error. */ | 891 /* Unreachable, but having the return prevents a compiler error. */ |
881 return ret_code; | 892 return ret_code; |
882 } | 893 } |
OLD | NEW |