Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: src/trusted/service_runtime/sel_main.c

Issue 10681005: Allow sel_ldr to continue without the IRT, when nexe doesn't have segment gap (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: simpler check? Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/trusted/service_runtime/sel_main.c
diff --git a/src/trusted/service_runtime/sel_main.c b/src/trusted/service_runtime/sel_main.c
index 35a9b14dfb497aa509b42eb1253de2f0cbe995d5..4c257b8951a8bc53b820751e29f8d3ba08c9e862 100644
--- a/src/trusted/service_runtime/sel_main.c
+++ b/src/trusted/service_runtime/sel_main.c
@@ -44,6 +44,7 @@
#include "native_client/src/trusted/service_runtime/nacl_globals.h"
#include "native_client/src/trusted/service_runtime/nacl_signal.h"
#include "native_client/src/trusted/service_runtime/nacl_syscall_common.h"
+#include "native_client/src/trusted/service_runtime/nacl_text.h"
#include "native_client/src/trusted/service_runtime/nacl_valgrind_hooks.h"
#include "native_client/src/trusted/service_runtime/osx/mach_exception_handler.h"
#include "native_client/src/trusted/service_runtime/outer_sandbox.h"
@@ -678,18 +679,24 @@ int main(int argc,
NaClGdbHook(&state);
}
-
if (NULL != blob_library_file) {
if (LOAD_OK == errcode) {
- NaClLog(2, "Loading blob file %s\n", blob_library_file);
- errcode = NaClAppLoadFileDynamically(nap, (struct Gio *) &blob_file);
- if (LOAD_OK != errcode) {
- fprintf(stderr, "Error while loading \"%s\": %s\n",
- blob_library_file,
- NaClErrorString(errcode));
+ if (NaClHasSegmentGapForDyncode(nap)) {
+ NaClLog(2, "Loading blob file %s\n", blob_library_file);
+ errcode = NaClAppLoadFileDynamically(nap, (struct Gio *) &blob_file);
+ if (LOAD_OK != errcode) {
+ fprintf(stderr, "Error while loading \"%s\": %s\n",
+ blob_library_file,
+ NaClErrorString(errcode));
+ }
+ NaClPerfCounterMark(&time_all_main, "BlobLoaded");
+ NaClPerfCounterIntervalLast(&time_all_main);
+ } else {
+ fprintf(
Mark Seaborn 2012/06/28 22:05:11 Can you use NaClLog() instead of fprintf(), please
jvoung (off chromium) 2012/06/28 22:41:56 Done. The other code around here used fprintf for
+ stderr,
+ "WARNING: NaCl app doesn't have a segment gap, not loading IRT.\n"
+ "This is expected for PNaCl's translator nexes.\n");
}
- NaClPerfCounterMark(&time_all_main, "BlobLoaded");
- NaClPerfCounterIntervalLast(&time_all_main);
}
if (-1 == (*((struct Gio *) &blob_file)->vtbl->Close)((struct Gio *)

Powered by Google App Engine
This is Rietveld 408576698