-
-
Save rolfbjarne/4b28abe9590227419547 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit f04caf86e9725926d51f20ad78ac65f7f045b115 | |
Author: Rolf Bjarne Kvinge <[email protected]> | |
Date: Wed Jan 6 13:56:43 2016 +0100 | |
[aot] Fix emission of external aot data by aligning tables in the file. | |
The table reading code depends on data being aligned, so make sure it is. | |
diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c | |
index 3c803ae..4c7edd5 100644 | |
--- a/mono/mini/aot-compiler.c | |
+++ b/mono/mini/aot-compiler.c | |
@@ -2335,6 +2335,11 @@ emit_aot_data (MonoAotCompile *acfg, MonoAotFileTable table, const char *symbol, | |
acfg->table_offsets [(int)table] = acfg->datafile_offset; | |
fwrite (data,1, size, acfg->data_outfile); | |
acfg->datafile_offset += size; | |
+ // align the data to 8 bytes. Put zeros in the file (so that every build results in consistent output). | |
+ int remained = 8 - size % 8; | |
+ acfg->datafile_offset += remained; | |
+ for (int i = 0; i < remained; i++) | |
+ fwrite ("", 1, 1, acfg->data_outfile); | |
} else if (acfg->llvm) { | |
mono_llvm_emit_aot_data (symbol, data, size); | |
} else { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment