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 #include <assert.h> | 7 #include <assert.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 if (validation_error & BPL_MODIFIED) | 106 if (validation_error & BPL_MODIFIED) |
107 printf("offset 0x%"NACL_PRIxS": error - %%bpl or %%bp is changed\n", | 107 printf("offset 0x%"NACL_PRIxS": error - %%bpl or %%bp is changed\n", |
108 offset); | 108 offset); |
109 if (validation_error & SPL_MODIFIED) | 109 if (validation_error & SPL_MODIFIED) |
110 printf("offset 0x%"NACL_PRIxS": error - %%spl or %%sp is changed\n", | 110 printf("offset 0x%"NACL_PRIxS": error - %%spl or %%sp is changed\n", |
111 offset); | 111 offset); |
112 if (validation_error & BAD_CALL_ALIGNMENT) | 112 if (validation_error & BAD_CALL_ALIGNMENT) |
113 printf("offset 0x%"NACL_PRIxS": warning - bad call alignment\n", offset); | 113 printf("offset 0x%"NACL_PRIxS": warning - bad call alignment\n", offset); |
114 if (validation_error & BAD_JUMP_TARGET) | 114 if (validation_error & BAD_JUMP_TARGET) |
115 printf("bad jump to around 0x%"NACL_PRIxS"\n", offset); | 115 printf("bad jump to around 0x%"NACL_PRIxS"\n", offset); |
116 if (validation_error & (VALIDATION_ERRORS | BAD_JUMP_TARGET)) | 116 if (validation_error & (VALIDATION_ERRORS_MASK | BAD_JUMP_TARGET)) |
117 return FALSE; | 117 return FALSE; |
118 else | 118 else |
119 return TRUE; | 119 return TRUE; |
120 } | 120 } |
121 | 121 |
122 Bool ValidateFile(const char *filename, int repeat_count, | 122 Bool ValidateFile(const char *filename, int repeat_count, |
123 enum validation_options options, | 123 enum validation_options options, |
124 const NaClCPUFeaturesX86 *cpu_features) { | 124 const NaClCPUFeaturesX86 *cpu_features) { |
125 size_t data_size; | 125 size_t data_size; |
126 uint8_t *data; | 126 uint8_t *data; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 options, | 245 options, |
246 use_old_features ? &validator_cpuid_features : | 246 use_old_features ? &validator_cpuid_features : |
247 &full_cpuid_features); | 247 &full_cpuid_features); |
248 if (!rc) { | 248 if (!rc) { |
249 printf("file '%s' can not be fully validated\n", filename); | 249 printf("file '%s' can not be fully validated\n", filename); |
250 return 1; | 250 return 1; |
251 } | 251 } |
252 } | 252 } |
253 return 0; | 253 return 0; |
254 } | 254 } |
OLD | NEW |