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

Unified Diff: src/trusted/service_runtime/nacl_text.c

Issue 12600034: Provide metadata to validator to allow faster caching. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: First fixes Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/trusted/service_runtime/nacl_text.c
diff --git a/src/trusted/service_runtime/nacl_text.c b/src/trusted/service_runtime/nacl_text.c
index 047ec6c6f51d58317524713f62b2ee3b0a074260..af4dd3753983755fb7d0cc805e3a92ddf2513bf4 100644
--- a/src/trusted/service_runtime/nacl_text.c
+++ b/src/trusted/service_runtime/nacl_text.c
@@ -624,7 +624,8 @@ static INLINE void NaClTextMapClearCacheIfNeeded(struct NaClApp *nap,
int32_t NaClTextDyncodeCreate(struct NaClApp *nap,
uint32_t dest,
void *code_copy,
- uint32_t size) {
+ uint32_t size,
+ const struct NaClValidationMetadata *metadata) {
uintptr_t dest_addr;
uint8_t *mapped_addr;
int32_t retval = -NACL_ABI_EINVAL;
@@ -671,7 +672,7 @@ int32_t NaClTextDyncodeCreate(struct NaClApp *nap,
* See: http://code.google.com/p/nativeclient/issues/detail?id=2566
*/
if (!nap->skip_validator) {
- validator_result = NaClValidateCode(nap, dest, code_copy, size);
+ validator_result = NaClValidateCode(nap, dest, code_copy, size, metadata);
} else {
NaClLog(LOG_ERROR, "VALIDATION SKIPPED.\n");
validator_result = LOAD_OK;
@@ -751,7 +752,8 @@ int32_t NaClSysDyncodeCreate(struct NaClAppThread *natp,
}
memcpy(code_copy, (uint8_t*) src_addr, size);
- retval = NaClTextDyncodeCreate(nap, dest, code_copy, size);
+ /* Unknown data source, no metadata. */
+ retval = NaClTextDyncodeCreate(nap, dest, code_copy, size, NULL);
free(code_copy);
return retval;

Powered by Google App Engine
This is Rietveld 408576698