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 /* | 7 /* |
8 * NaCl helper functions to deal with elf images | 8 * NaCl helper functions to deal with elf images |
9 */ | 9 */ |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 * allow optional GNU stack permission marker, but require that the | 84 * allow optional GNU stack permission marker, but require that the |
85 * stack is non-executable. | 85 * stack is non-executable. |
86 */ | 86 */ |
87 { PT_GNU_STACK, PF_R|PF_W, PCA_NONE, 0, 0, }, | 87 { PT_GNU_STACK, PF_R|PF_W, PCA_NONE, 0, 0, }, |
88 /* ignored segments */ | 88 /* ignored segments */ |
89 { PT_DYNAMIC, PF_R, PCA_IGNORE, 0, 0}, | 89 { PT_DYNAMIC, PF_R, PCA_IGNORE, 0, 0}, |
90 { PT_INTERP, PF_R, PCA_IGNORE, 0, 0}, | 90 { PT_INTERP, PF_R, PCA_IGNORE, 0, 0}, |
91 { PT_NOTE, PF_R, PCA_IGNORE, 0, 0}, | 91 { PT_NOTE, PF_R, PCA_IGNORE, 0, 0}, |
92 { PT_GNU_EH_FRAME, PF_R, PCA_IGNORE, 0, 0}, | 92 { PT_GNU_EH_FRAME, PF_R, PCA_IGNORE, 0, 0}, |
93 { PT_GNU_RELRO, PF_R, PCA_IGNORE, 0, 0}, | 93 { PT_GNU_RELRO, PF_R, PCA_IGNORE, 0, 0}, |
| 94 #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_mips |
| 95 { PT_MIPS_REGINFO, PF_R, PCA_IGNORE, 0, 0}, |
| 96 #endif |
94 { PT_NULL, PF_R, PCA_IGNORE, 0, 0}, | 97 { PT_NULL, PF_R, PCA_IGNORE, 0, 0}, |
95 }; | 98 }; |
96 | 99 |
97 | 100 |
98 #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 | 101 #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 |
99 # if NACL_BUILD_SUBARCH == 32 | 102 # if NACL_BUILD_SUBARCH == 32 |
100 # define EM_EXPECTED_BY_NACL EM_386 | 103 # define EM_EXPECTED_BY_NACL EM_386 |
101 # elif NACL_BUILD_SUBARCH == 64 | 104 # elif NACL_BUILD_SUBARCH == 64 |
102 # define EM_EXPECTED_BY_NACL EM_X86_64 | 105 # define EM_EXPECTED_BY_NACL EM_X86_64 |
103 # else | 106 # else |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 | 752 |
750 | 753 |
751 void NaClElfImageDelete(struct NaClElfImage *image) { | 754 void NaClElfImageDelete(struct NaClElfImage *image) { |
752 free(image); | 755 free(image); |
753 } | 756 } |
754 | 757 |
755 | 758 |
756 uintptr_t NaClElfImageGetEntryPoint(struct NaClElfImage *image) { | 759 uintptr_t NaClElfImageGetEntryPoint(struct NaClElfImage *image) { |
757 return image->ehdr.e_entry; | 760 return image->ehdr.e_entry; |
758 } | 761 } |
OLD | NEW |