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

Unified Diff: src/trusted/service_runtime/sel_main_chrome.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: address review comments 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_chrome.c
diff --git a/src/trusted/service_runtime/sel_main_chrome.c b/src/trusted/service_runtime/sel_main_chrome.c
index 35dfa02a120fd8a4400c750dbf7c775d798a5766..e7dbfe1c49b9c7c993d59948c2f9e2e7ea14d73e 100644
--- a/src/trusted/service_runtime/sel_main_chrome.c
+++ b/src/trusted/service_runtime/sel_main_chrome.c
@@ -280,8 +280,22 @@ void NaClChromeMainStart(struct NaClChromeMainArgs *args) {
goto done;
}
- /* Load the integrated runtime (IRT) library. */
- NaClLoadIrt(nap, args->irt_fd);
+ /*
+ * Load the integrated runtime (IRT) library.
+ * We check if there is a segment gap before trying to load the IRT. This
+ * is to support IRT-less / segment-gap-free PNaCl translator nexes.
+ * TODO(mseaborn): Plumb through a flag from Chrome in such cases,
+ * instead of looking for the absence of a segment gap, to provide better
+ * diagnostics when the linker did not create a segment gap!
Mark Seaborn 2012/06/28 22:50:55 ditto: "when the nexe does not follow NaCl's stabl
jvoung - send to chromium... 2012/06/28 23:02:50 Done.
+ */
+ if (NULL != nap->text_shm) {
+ NaClLoadIrt(nap, args->irt_fd);
+ } else {
+ NaClLog(
+ LOG_WARNING,
+ "Main executable has no segment gap; skipping loading IRT library.\n"
Mark Seaborn 2012/06/28 22:50:55 ditto about multi-line
jvoung - send to chromium... 2012/06/28 23:02:50 Done.
+ "This is expected for PNaCl's translator nexes.\n");
+ }
NaClEnvCleanserCtor(&env_cleanser, 1);
if (!NaClEnvCleanserInit(&env_cleanser, envp, NULL)) {
« src/trusted/service_runtime/sel_main.c ('K') | « src/trusted/service_runtime/sel_main.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698