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

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: 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_chrome.c
diff --git a/src/trusted/service_runtime/sel_main_chrome.c b/src/trusted/service_runtime/sel_main_chrome.c
index 35dfa02a120fd8a4400c750dbf7c775d798a5766..781aaa0f6ae397fdb7b454446edb3763026f1395 100644
--- a/src/trusted/service_runtime/sel_main_chrome.c
+++ b/src/trusted/service_runtime/sel_main_chrome.c
@@ -30,6 +30,7 @@
#include "native_client/src/trusted/service_runtime/nacl_all_modules.h"
#include "native_client/src/trusted/service_runtime/nacl_debug_init.h"
#include "native_client/src/trusted/service_runtime/nacl_signal.h"
+#include "native_client/src/trusted/service_runtime/nacl_text.h"
#include "native_client/src/trusted/service_runtime/osx/mach_exception_handler.h"
#include "native_client/src/trusted/service_runtime/sel_addrspace.h"
#include "native_client/src/trusted/service_runtime/sel_ldr.h"
@@ -281,7 +282,19 @@ void NaClChromeMainStart(struct NaClChromeMainArgs *args) {
}
/* Load the integrated runtime (IRT) library. */
- NaClLoadIrt(nap, args->irt_fd);
+ /* We check if there is a segment gap before trying to load the IRT. This
Mark Seaborn 2012/06/28 22:05:11 The comment style is /* * blah * blah */ Can y
jvoung (off chromium) 2012/06/28 22:41:56 Done.
+ * is to support IRT-less / segment-gap-free PNaCl translator nexes.
+ * We should plumb through a flag from Chrome in such cases, instead of
Mark Seaborn 2012/06/28 22:05:11 Can you make this: "TODO(mseaborn): Plumb through
jvoung (off chromium) 2012/06/28 22:41:56 Done.
+ * looking for the absence of a segment gap, to provide better diagnostics
+ * when the linker did not create a segment gap!
+ */
+ if (NaClHasSegmentGapForDyncode(nap)) {
+ NaClLoadIrt(nap, args->irt_fd);
+ } else {
+ NaClLog(LOG_WARNING,
+ "NaCl app doesn't have a segment gap, not loading IRT.\n"
Mark Seaborn 2012/06/28 22:05:11 'executable' rather than 'app'? "Main executable
jvoung (off chromium) 2012/06/28 22:41:56 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