Skip to content

Commit

Permalink
Parse remaining linking section subsections types
Browse files Browse the repository at this point in the history
  • Loading branch information
radekdoulik committed Dec 4, 2024
1 parent 3fe8dce commit 4d02e51
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions wa-lib/WasmObjFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,34 @@ void ReadCustomLinkingSection(UInt32 size)
Console.WriteLine($"Segment {i} name: {name} alignment: {alignment} flags: {flags}");
}
break;
// case LinkingSubsectionType.WasmInitFunctions:
// break;
// case LinkingSubsectionType.WasmComdatInfo:
// break;
case LinkingSubsectionType.WasmInitFunctions:
count = ReadU32();
for (var i = 0; i < count; i++)
{
var priority = ReadU32();
var symbolIndex = ReadU32();
if (Context.Verbose)
Console.WriteLine($"Init function {i} priority: {priority} symbol index: {symbolIndex}");
}
break;
case LinkingSubsectionType.WasmComdatInfo:
count = ReadU32();
for (var i = 0; i < count; i++)
{
var name = ReadString();
var flags = ReadU32();
if (Context.Verbose)
Console.WriteLine($"COMDAT {i} name: {name} flags: {flags}");
var symbolsCount = ReadU32();
for (var j = 0; j < symbolsCount; j++)
{
var kind = (SymbolKind)Reader.ReadByte();
var symbolIndex = ReadU32();
if (Context.Verbose)
Console.WriteLine($" Symbol {j} kind: {kind} index: {symbolIndex}");
}
}
break;
case LinkingSubsectionType.WasmSymbolTable:
LinkingReadSymbolTable();
break;
Expand Down

0 comments on commit 4d02e51

Please sign in to comment.