| 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 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" | 7 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" |
| 8 | 8 |
| 9 #include "native_client/src/shared/platform/nacl_log.h" | 9 #include "native_client/src/shared/platform/nacl_log.h" |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 case LOAD_DUP_LOAD_MODULE: /* -R: nexe supplied by RPC, but only once! */ | 23 case LOAD_DUP_LOAD_MODULE: /* -R: nexe supplied by RPC, but only once! */ |
| 24 return "Multiple LoadModule RPCs"; | 24 return "Multiple LoadModule RPCs"; |
| 25 case LOAD_DUP_START_MODULE: /* -X: implies StartModule RPC, but once! */ | 25 case LOAD_DUP_START_MODULE: /* -X: implies StartModule RPC, but once! */ |
| 26 return "Multiple StartModule RPCs"; | 26 return "Multiple StartModule RPCs"; |
| 27 case LOAD_OPEN_ERROR: | 27 case LOAD_OPEN_ERROR: |
| 28 return "Cannot open NaCl module file"; | 28 return "Cannot open NaCl module file"; |
| 29 case LOAD_READ_ERROR: | 29 case LOAD_READ_ERROR: |
| 30 return "Cannot read file"; | 30 return "Cannot read file"; |
| 31 case LOAD_TOO_MANY_PROG_HDRS: | 31 case LOAD_TOO_MANY_PROG_HDRS: |
| 32 return "Too many program header entries in ELF file"; | 32 return "Too many program header entries in ELF file"; |
| 33 case LOAD_PROG_HDR_SIZE_TOO_SMALL: | 33 case LOAD_BAD_PHENTSIZE: |
| 34 return "ELF program header size too small"; | 34 return "ELF program header size wrong"; |
| 35 case LOAD_BAD_ELF_MAGIC: | 35 case LOAD_BAD_ELF_MAGIC: |
| 36 return "Bad ELF header magic number"; | 36 return "Bad ELF header magic number"; |
| 37 case LOAD_NOT_32_BIT: | 37 case LOAD_NOT_32_BIT: |
| 38 return "Not a 32-bit ELF file"; | 38 return "Not a 32-bit ELF file"; |
| 39 case LOAD_NOT_64_BIT: | 39 case LOAD_NOT_64_BIT: |
| 40 return "Not a 64-bit ELF file"; | 40 return "Not a 64-bit ELF file"; |
| 41 case LOAD_BAD_ABI: | 41 case LOAD_BAD_ABI: |
| 42 return "ELF file has unexpected OS ABI"; | 42 return "ELF file has unexpected OS ABI"; |
| 43 case LOAD_NOT_EXEC: | 43 case LOAD_NOT_EXEC: |
| 44 return "ELF file type not executable"; | 44 return "ELF file type not executable"; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 case LOAD_REQUIRED_SEG_MISSING: | 127 case LOAD_REQUIRED_SEG_MISSING: |
| 128 return "ELF executable missing a required segment (text)"; | 128 return "ELF executable missing a required segment (text)"; |
| 129 case LOAD_SEGMENT_BAD_PARAM: | 129 case LOAD_SEGMENT_BAD_PARAM: |
| 130 return "ELF executable segment header parameter error"; | 130 return "ELF executable segment header parameter error"; |
| 131 case LOAD_VALIDATION_FAILED: | 131 case LOAD_VALIDATION_FAILED: |
| 132 return "Validation failure. File violates Native Client safety rules."; | 132 return "Validation failure. File violates Native Client safety rules."; |
| 133 case LOAD_UNIMPLEMENTED: | 133 case LOAD_UNIMPLEMENTED: |
| 134 return "Not implemented for this architecture."; | 134 return "Not implemented for this architecture."; |
| 135 case SRT_NO_SEG_SEL: | 135 case SRT_NO_SEG_SEL: |
| 136 return "Service Runtime: cannot allocate segment selector"; | 136 return "Service Runtime: cannot allocate segment selector"; |
| 137 case LOAD_BAD_EHSIZE: |
| 138 return "ELFCLASS64 file header has wrong e_ehsize value"; |
| 139 case LOAD_EHDR_OVERFLOW: |
| 140 return "ELFCLASS64 file header has fields that overflow 32 bits"; |
| 141 case LOAD_PHDR_OVERFLOW: |
| 142 return "ELFCLASS64 program header has fields that overflow 32 bits"; |
| 137 } | 143 } |
| 138 | 144 |
| 139 /* | 145 /* |
| 140 * do not use default case label, to make sure that the compiler | 146 * do not use default case label, to make sure that the compiler |
| 141 * will generate a warning with -Wswitch-enum for new codes | 147 * will generate a warning with -Wswitch-enum for new codes |
| 142 * introduced in nacl_error_codes.h for which there is no | 148 * introduced in nacl_error_codes.h for which there is no |
| 143 * corresponding entry here. instead, we pretend that fall-through | 149 * corresponding entry here. instead, we pretend that fall-through |
| 144 * from the switch is possible. (otherwise -W complains control | 150 * from the switch is possible. (otherwise -W complains control |
| 145 * reaches end of non-void function.) | 151 * reaches end of non-void function.) |
| 146 */ | 152 */ |
| 147 return "BAD ERROR CODE"; | 153 return "BAD ERROR CODE"; |
| 148 } | 154 } |
| OLD | NEW |