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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 } | 273 } |
274 } | 274 } |
275 | 275 |
276 /* | 276 /* |
277 * error reporting done; can quit now if there was an error earlier. | 277 * error reporting done; can quit now if there was an error earlier. |
278 */ | 278 */ |
279 if (LOAD_OK != errcode) { | 279 if (LOAD_OK != errcode) { |
280 goto done; | 280 goto done; |
281 } | 281 } |
282 | 282 |
283 /* Load the integrated runtime (IRT) library. */ | 283 /* |
284 NaClLoadIrt(nap, args->irt_fd); | 284 * Load the integrated runtime (IRT) library. |
| 285 * We check if there is a segment gap before trying to load the IRT. This |
| 286 * is to support IRT-less / segment-gap-free PNaCl translator nexes. |
| 287 * TODO(mseaborn): Plumb through a flag from Chrome in such cases, |
| 288 * instead of looking for the absence of a segment gap, when the nexe does |
| 289 * not follow NaCl's stable ABI. |
| 290 */ |
| 291 if (NULL != nap->text_shm) { |
| 292 NaClLoadIrt(nap, args->irt_fd); |
| 293 } else { |
| 294 NaClLog( |
| 295 LOG_WARNING, |
| 296 "Main executable has no segment gap; skipping loading IRT library. " |
| 297 "This is expected for PNaCl's translator nexes.\n"); |
| 298 } |
285 | 299 |
286 NaClEnvCleanserCtor(&env_cleanser, 1); | 300 NaClEnvCleanserCtor(&env_cleanser, 1); |
287 if (!NaClEnvCleanserInit(&env_cleanser, envp, NULL)) { | 301 if (!NaClEnvCleanserInit(&env_cleanser, envp, NULL)) { |
288 NaClLog(LOG_FATAL, "Failed to initialise env cleanser\n"); | 302 NaClLog(LOG_FATAL, "Failed to initialise env cleanser\n"); |
289 } | 303 } |
290 | 304 |
291 if (!NaClAppLaunchServiceThreads(nap)) { | 305 if (!NaClAppLaunchServiceThreads(nap)) { |
292 fprintf(stderr, "Launch service threads failed\n"); | 306 fprintf(stderr, "Launch service threads failed\n"); |
293 goto done; | 307 goto done; |
294 } | 308 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 if (LOAD_OK != errcode) { | 346 if (LOAD_OK != errcode) { |
333 NaClBlockIfCommandChannelExists(nap); | 347 NaClBlockIfCommandChannelExists(nap); |
334 } | 348 } |
335 | 349 |
336 done_ctor: | 350 done_ctor: |
337 | 351 |
338 NaClAllModulesFini(); | 352 NaClAllModulesFini(); |
339 | 353 |
340 NaClExit(ret_code); | 354 NaClExit(ret_code); |
341 } | 355 } |
OLD | NEW |