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

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

Issue 2107012: Update the verifier to work with both gold and ld produced binaries. (Closed) Base URL: http://nativeclient.googlecode.com/svn/trunk/src/native_client/
Patch Set: '' Created 10 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/barebones/nacl.scons » ('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 2009 The Native Client Authors. All rights reserved. 2 * Copyright 2009 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 /* 7 /*
8 * NaCl helper functions to deal with elf images 8 * NaCl helper functions to deal with elf images
9 */ 9 */
10 10
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 /* record our decision that we will load this segment */ 309 /* record our decision that we will load this segment */
310 310
311 /* 311 /*
312 * NACL_TRAMPOLINE_END <= p_vaddr 312 * NACL_TRAMPOLINE_END <= p_vaddr
313 * <= p_vaddr + p_memsz 313 * <= p_vaddr + p_memsz
314 * < ((uintptr_t) 1U << nap->addr_bits) 314 * < ((uintptr_t) 1U << nap->addr_bits)
315 */ 315 */
316 if (*max_vaddr < php->p_vaddr + php->p_memsz) { 316 if (*max_vaddr < php->p_vaddr + php->p_memsz) {
317 *max_vaddr = php->p_vaddr + php->p_memsz; 317 *max_vaddr = php->p_vaddr + php->p_memsz;
318 } 318 }
319 }
320 319
321 switch (nacl_phdr_check_data[j].action) { 320 switch (nacl_phdr_check_data[j].action) {
322 case PCA_NONE: 321 case PCA_NONE:
323 break; 322 break;
324 case PCA_TEXT_CHECK: 323 case PCA_TEXT_CHECK:
325 if (0 == php->p_memsz) { 324 if (0 == php->p_memsz) {
326 return LOAD_BAD_ELF_TEXT; 325 return LOAD_BAD_ELF_TEXT;
327 } 326 }
328 *static_text_end = NACL_TRAMPOLINE_END + php->p_filesz; 327 *static_text_end = NACL_TRAMPOLINE_END + php->p_filesz;
329 break; 328 break;
330 case PCA_RODATA: 329 case PCA_RODATA:
331 *rodata_start = php->p_vaddr; 330 *rodata_start = php->p_vaddr;
332 *rodata_end = php->p_vaddr + php->p_memsz; 331 *rodata_end = php->p_vaddr + php->p_memsz;
333 break; 332 break;
334 case PCA_DATA: 333 case PCA_DATA:
335 *data_start = php->p_vaddr; 334 *data_start = php->p_vaddr;
336 *data_end = php->p_vaddr + php->p_memsz; 335 *data_end = php->p_vaddr + php->p_memsz;
337 break; 336 break;
338 case PCA_IGNORE: 337 case PCA_IGNORE:
339 break; 338 break;
339 }
340 } 340 }
341 goto next_seg; 341 goto next_seg;
342 } 342 }
343 } 343 }
344 /* segment not in nacl_phdr_check_data */ 344 /* segment not in nacl_phdr_check_data */
345 if (0 == php->p_memsz) { 345 if (0 == php->p_memsz) {
346 NaClLog(3, "Segment %d zero size: ignored\n", segnum); 346 NaClLog(3, "Segment %d zero size: ignored\n", segnum);
347 continue; 347 continue;
348 } 348 }
349 NaClLog(2, 349 NaClLog(2,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 return 16; 540 return 16;
541 case EF_NACL_ALIGN_32: 541 case EF_NACL_ALIGN_32:
542 return 32; 542 return 32;
543 default: 543 default:
544 #if 0 == NACL_DANGEROUS_DEBUG_MODE_DISABLE_INNER_SANDBOX 544 #if 0 == NACL_DANGEROUS_DEBUG_MODE_DISABLE_INNER_SANDBOX
545 NaClLog(LOG_FATAL, "strange alignment"); 545 NaClLog(LOG_FATAL, "strange alignment");
546 #endif 546 #endif
547 return 0; 547 return 0;
548 } 548 }
549 } 549 }
OLDNEW
« no previous file with comments | « no previous file | tests/barebones/nacl.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698