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..5730f8fb327634d4dfff2d936b3db4831704fb34 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, when the nexe does |
+ * not follow NaCl's stable ABI. |
+ */ |
+ if (NULL != nap->text_shm) { |
+ NaClLoadIrt(nap, args->irt_fd); |
+ } else { |
+ NaClLog( |
+ LOG_WARNING, |
+ "Main executable has no segment gap; skipping loading IRT library. " |
+ "This is expected for PNaCl's translator nexes.\n"); |
+ } |
NaClEnvCleanserCtor(&env_cleanser, 1); |
if (!NaClEnvCleanserInit(&env_cleanser, envp, NULL)) { |