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

Side by Side Diff: src/trusted/service_runtime/sel_ldr.c

Issue 4181005: Fixes some bugs with memory setup and halt-sled allocation and... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/trusted/service_runtime/nacl_text.c ('k') | src/trusted/service_runtime/sel_ldr_standard.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Native Client Authors. All rights reserved. 2 * Copyright 2008 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file. 4 * be found in the LICENSE file.
5 */ 5 */
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 /* 9 /*
10 * NaCl Simple/secure ELF loader (NaCl SEL). 10 * NaCl Simple/secure ELF loader (NaCl SEL).
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 } 354 }
355 355
356 void NaClMemRegionPrinter(void *state, 356 void NaClMemRegionPrinter(void *state,
357 struct NaClVmmapEntry *entry) { 357 struct NaClVmmapEntry *entry) {
358 struct Gio *gp = (struct Gio *) state; 358 struct Gio *gp = (struct Gio *) state;
359 359
360 gprintf(gp, "\nPage %"NACL_PRIdPTR" (0x%"NACL_PRIxPTR")\n", 360 gprintf(gp, "\nPage %"NACL_PRIdPTR" (0x%"NACL_PRIxPTR")\n",
361 entry->page_num, entry->page_num); 361 entry->page_num, entry->page_num);
362 gprintf(gp, "npages %"NACL_PRIdS" (0x%"NACL_PRIxS")\n", entry->npages, 362 gprintf(gp, "npages %"NACL_PRIdS" (0x%"NACL_PRIxS")\n", entry->npages,
363 entry->npages); 363 entry->npages);
364 gprintf(gp, "start vaddr 0x%"NACL_PRIxPTR"\n",
365 entry->page_num << NACL_PAGESHIFT);
366 gprintf(gp, "end vaddr 0x%"NACL_PRIxPTR"\n",
367 (entry->page_num + entry->npages) << NACL_PAGESHIFT);
364 gprintf(gp, "prot 0x%08x\n", entry->prot); 368 gprintf(gp, "prot 0x%08x\n", entry->prot);
365 gprintf(gp, "%sshared/backed by a file\n", 369 gprintf(gp, "%sshared/backed by a file\n",
366 (NULL == entry->nmop) ? "not " : ""); 370 (NULL == entry->nmop) ? "not " : "");
367 } 371 }
368 372
369 void NaClAppPrintDetails(struct NaClApp *nap, 373 void NaClAppPrintDetails(struct NaClApp *nap,
370 struct Gio *gp) { 374 struct Gio *gp) {
371 NaClXMutexLock(&nap->mu); 375 NaClXMutexLock(&nap->mu);
372 gprintf(gp, 376 gprintf(gp,
373 "NaClAppPrintDetails((struct NaClApp *) 0x%08"NACL_PRIxPTR"," 377 "NaClAppPrintDetails((struct NaClApp *) 0x%08"NACL_PRIxPTR","
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 return "Read-only data segment overlaps data segment"; 463 return "Read-only data segment overlaps data segment";
460 case LOAD_DATA_NOT_LAST_SEGMENT: 464 case LOAD_DATA_NOT_LAST_SEGMENT:
461 return "Data segment exists, but is not last segment"; 465 return "Data segment exists, but is not last segment";
462 case LOAD_NO_DATA_BUT_RODATA_NOT_LAST_SEGMENT: 466 case LOAD_NO_DATA_BUT_RODATA_NOT_LAST_SEGMENT:
463 return ("No data segment, read-only data segment exists," 467 return ("No data segment, read-only data segment exists,"
464 " but is not last segment"); 468 " but is not last segment");
465 case LOAD_TEXT_OVERLAPS_RODATA: 469 case LOAD_TEXT_OVERLAPS_RODATA:
466 return "Text segment overlaps rodata segment"; 470 return "Text segment overlaps rodata segment";
467 case LOAD_TEXT_OVERLAPS_DATA: 471 case LOAD_TEXT_OVERLAPS_DATA:
468 return "No rodata segment, and text segment overlaps data segment"; 472 return "No rodata segment, and text segment overlaps data segment";
473 case LOAD_BAD_RODATA_ALIGNMENT:
474 return "The rodata segment is not properly aligned";
475 case LOAD_BAD_DATA_ALIGNMENT:
476 return "The data segment is not properly aligned";
469 case LOAD_UNLOADABLE: 477 case LOAD_UNLOADABLE:
470 return "Error during loading"; 478 return "Error during loading";
471 case LOAD_BAD_ELF_TEXT: 479 case LOAD_BAD_ELF_TEXT:
472 return "ELF file contains no text segment"; 480 return "ELF file contains no text segment";
473 case LOAD_TEXT_SEG_TOO_BIG: 481 case LOAD_TEXT_SEG_TOO_BIG:
474 return "ELF file text segment too large"; 482 return "ELF file text segment too large";
475 case LOAD_DATA_SEG_TOO_BIG: 483 case LOAD_DATA_SEG_TOO_BIG:
476 return "ELF file data segment(s) too large"; 484 return "ELF file data segment(s) too large";
477 case LOAD_MPROTECT_FAIL: 485 case LOAD_MPROTECT_FAIL:
478 return "Cannot protect pages"; 486 return "Cannot protect pages";
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 nacl_global_xlate_base = mem_start; 1161 nacl_global_xlate_base = mem_start;
1154 1162
1155 #ifdef __GNUC__ 1163 #ifdef __GNUC__
1156 _ovly_debug_event (); 1164 _ovly_debug_event ();
1157 #endif 1165 #endif
1158 } 1166 }
1159 1167
1160 void NaClGdbHook(struct NaClApp const *nap) { 1168 void NaClGdbHook(struct NaClApp const *nap) {
1161 StopForDebuggerInit(nap->mem_start); 1169 StopForDebuggerInit(nap->mem_start);
1162 } 1170 }
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/nacl_text.c ('k') | src/trusted/service_runtime/sel_ldr_standard.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698