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 #include "native_client/src/trusted/service_runtime/sel_main_chrome.h" | 7 #include "native_client/src/trusted/service_runtime/sel_main_chrome.h" |
8 | 8 |
9 #include "native_client/src/include/portability.h" | 9 #include "native_client/src/include/portability.h" |
10 #include "native_client/src/include/portability_io.h" | 10 #include "native_client/src/include/portability_io.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 * error reporting done; can quit now if there was an error earlier. | 301 * error reporting done; can quit now if there was an error earlier. |
302 */ | 302 */ |
303 if (LOAD_OK != errcode) { | 303 if (LOAD_OK != errcode) { |
304 goto done; | 304 goto done; |
305 } | 305 } |
306 | 306 |
307 /* | 307 /* |
308 * Load the integrated runtime (IRT) library. | 308 * Load the integrated runtime (IRT) library. |
309 * We check if there is a segment gap before trying to load the IRT. This | 309 * We check if there is a segment gap before trying to load the IRT. This |
310 * is to support IRT-less / segment-gap-free PNaCl translator nexes. | 310 * is to support IRT-less / segment-gap-free PNaCl translator nexes. |
311 * TODO(mseaborn): Plumb through a flag from Chrome in such cases, | 311 * TODO(mseaborn): Instead of looking for the absence of a segment gap, |
Mark Seaborn
2013/01/03 23:36:40
You can change this to TODO(jvoung) if you're goin
jvoung (off chromium)
2013/01/04 00:05:31
Done.
| |
312 * instead of looking for the absence of a segment gap, when the nexe does | 312 * only allow irt_fd == -1, when the nexe does not follow NaCl's stable ABI. |
313 * not follow NaCl's stable ABI. | |
314 */ | 313 */ |
315 if (NULL != nap->text_shm) { | 314 if (NULL != nap->text_shm && args->irt_fd != -1) { |
316 NaClLoadIrt(nap, args->irt_fd); | 315 NaClLoadIrt(nap, args->irt_fd); |
317 } else { | 316 } else { |
318 NaClLog( | 317 NaClLog( |
319 LOG_WARNING, | 318 LOG_WARNING, |
320 "Main executable has no segment gap; skipping loading IRT library. " | 319 "Main executable has no segment gap or irt_fd == -1; " |
Mark Seaborn
2013/01/03 23:36:40
You should probably drop this log message, or chan
jvoung (off chromium)
2013/01/04 00:05:31
Done.
| |
321 "This is expected for PNaCl's translator nexes.\n"); | 320 "skipping loading IRT library. This is expected for PNaCl's " |
321 "translator nexes.\n"); | |
322 } | 322 } |
323 | 323 |
324 NACL_FI_FATAL("BeforeEnvCleanserCtor"); | 324 NACL_FI_FATAL("BeforeEnvCleanserCtor"); |
325 | 325 |
326 NaClEnvCleanserCtor(&env_cleanser, 1); | 326 NaClEnvCleanserCtor(&env_cleanser, 1); |
327 if (!NaClEnvCleanserInit(&env_cleanser, envp, NULL)) { | 327 if (!NaClEnvCleanserInit(&env_cleanser, envp, NULL)) { |
328 NaClLog(LOG_FATAL, "Failed to initialise env cleanser\n"); | 328 NaClLog(LOG_FATAL, "Failed to initialise env cleanser\n"); |
329 } | 329 } |
330 | 330 |
331 if (NACL_FI_ERROR_COND("LaunchServiceThreads", | 331 if (NACL_FI_ERROR_COND("LaunchServiceThreads", |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
378 * Instead, we wait for the hard-shutdown on the command channel. | 378 * Instead, we wait for the hard-shutdown on the command channel. |
379 */ | 379 */ |
380 if (LOAD_OK != errcode) { | 380 if (LOAD_OK != errcode) { |
381 NaClBlockIfCommandChannelExists(nap); | 381 NaClBlockIfCommandChannelExists(nap); |
382 } | 382 } |
383 | 383 |
384 NaClAllModulesFini(); | 384 NaClAllModulesFini(); |
385 | 385 |
386 NaClExit(ret_code); | 386 NaClExit(ret_code); |
387 } | 387 } |
OLD | NEW |