OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 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 /* | 7 /* |
8 * NaCl helper functions to deal with elf images | 8 * NaCl helper functions to deal with elf images |
9 */ | 9 */ |
10 | 10 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 } | 260 } |
261 | 261 |
262 /* | 262 /* |
263 * We will load this segment later. Do the sanity checks. | 263 * We will load this segment later. Do the sanity checks. |
264 */ | 264 */ |
265 if (0 != nacl_phdr_check_data[j].p_vaddr | 265 if (0 != nacl_phdr_check_data[j].p_vaddr |
266 && (nacl_phdr_check_data[j].p_vaddr != php->p_vaddr)) { | 266 && (nacl_phdr_check_data[j].p_vaddr != php->p_vaddr)) { |
267 NaClLog(2, | 267 NaClLog(2, |
268 ("Segment %d: bad virtual address: 0x%08" | 268 ("Segment %d: bad virtual address: 0x%08" |
269 NACL_PRIxElf_Addr"," | 269 NACL_PRIxElf_Addr"," |
270 " expected 0x%08"NACL_PRIxElf_Addr"\n"), | 270 " expected 0x%08"NACL_PRIxElf_Addr", reference segment %d\n"), |
271 segnum, | 271 segnum, |
272 php->p_vaddr, | 272 php->p_vaddr, |
273 nacl_phdr_check_data[j].p_vaddr); | 273 nacl_phdr_check_data[j].p_vaddr, (int) j); |
bsy
2011/09/27 23:27:28
use NACL_PRIdS in the format string as in other Na
| |
274 return LOAD_SEGMENT_BAD_LOC; | 274 return LOAD_SEGMENT_BAD_LOC; |
275 } | 275 } |
276 if (php->p_vaddr < NACL_TRAMPOLINE_END) { | 276 if (php->p_vaddr < NACL_TRAMPOLINE_END) { |
277 NaClLog(2, | 277 NaClLog(2, |
278 ("Segment %d: virtual address (0x%08"NACL_PRIxElf_Addr | 278 ("Segment %d: virtual address (0x%08"NACL_PRIxElf_Addr |
279 ") too low\n"), | 279 ") too low\n"), |
280 segnum, | 280 segnum, |
281 php->p_vaddr); | 281 php->p_vaddr); |
282 return LOAD_SEGMENT_OUTSIDE_ADDRSPACE; | 282 return LOAD_SEGMENT_OUTSIDE_ADDRSPACE; |
283 } | 283 } |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
652 | 652 |
653 | 653 |
654 void NaClElfImageDelete(struct NaClElfImage *image) { | 654 void NaClElfImageDelete(struct NaClElfImage *image) { |
655 free(image); | 655 free(image); |
656 } | 656 } |
657 | 657 |
658 | 658 |
659 uintptr_t NaClElfImageGetEntryPoint(struct NaClElfImage *image) { | 659 uintptr_t NaClElfImageGetEntryPoint(struct NaClElfImage *image) { |
660 return image->ehdr.e_entry; | 660 return image->ehdr.e_entry; |
661 } | 661 } |
OLD | NEW |