Skip to content

Commit 1a9c01c

Browse files
committed
[WIP] Update index format
1 parent 98bf8b5 commit 1a9c01c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/Xamarin.Android.Build.Tasks/Utilities/TypeMapGenerator.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,30 @@ public bool Generate (DirectoryAssemblyResolver resolver, IEnumerable<string> as
214214
return true;
215215
}
216216

217+
// Binary index file format, all data is little-endian:
218+
//
219+
// [Magic string] # XATI
220+
// [Format version] # 32-bit integer, 4 bytes
221+
// [Entry count] # 32-bit integer, 4 bytes
222+
// [Module file name width] # 32-bit integer, 4 bytes
223+
// [Index entries] # Format described below, [Entry count] entries
224+
//
225+
// Index entry format:
226+
//
227+
// [Module UUID][File name]<NUL>
228+
//
229+
// Where:
230+
//
231+
// [Module UUID] is 16 bytes long
232+
// [File name] is right-padded with <NUL> characters to the [Module file name width] boundary.
233+
//
217234
void OutputModules (string outputDirectory, IDictionary<byte[], ModuleData> modules, BinaryWriter indexWriter, int moduleFileNameWidth)
218235
{
219236
var moduleCounter = new Dictionary <AssemblyDefinition, int> ();
220237

221238
indexWriter.Write (typemapIndexMagicString);
239+
indexWriter.Write (TypeMapFormatVersion);
240+
indexWriter.Write (modules.Count);
222241
indexWriter.Write (moduleFileNameWidth);
223242

224243
foreach (var kvp in modules) {

src/monodroid/jni/xamarin-app.hh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ struct BinaryTypeMapHeader
2222
uint8_t assembly_name[];
2323
};
2424

25+
struct TypeMapIndexHeader
26+
{
27+
uint32_t magic;
28+
uint32_t version;
29+
uint32_t entry_count;
30+
uint32_t module_file_name_width;
31+
};
32+
2533
struct TypeMapModuleEntry
2634
{
2735
int32_t type_token_id;

0 commit comments

Comments
 (0)