[llvm-readobj] Dump wasm init functions

llvm-svn: 321042
This commit is contained in:
Sam Clegg 2017-12-19 00:04:41 +00:00
parent 0282091c9f
commit b23a20179a
1 changed files with 8 additions and 2 deletions

View File

@ -100,8 +100,8 @@ void WasmDumper::printRelocation(const SectionRef &Section,
W.printNumber("Addend", WasmReloc.Addend);
} else {
raw_ostream& OS = W.startLine();
OS << W.hex(Reloc.getOffset())
<< " " << RelocTypeName << "[" << WasmReloc.Index << "]";
OS << W.hex(Reloc.getOffset()) << " " << RelocTypeName << "["
<< WasmReloc.Index << "]";
if (HasAddend)
OS << " " << WasmReloc.Addend;
OS << "\n";
@ -156,6 +156,12 @@ void WasmDumper::printSections() {
if (WasmSec.Name == "linking") {
const wasm::WasmLinkingData &LinkingData = Obj->linkingData();
W.printNumber("DataSize", LinkingData.DataSize);
if (!LinkingData.InitFunctions.empty()) {
ListScope Group(W, "InitFunctions");
for (const wasm::WasmInitFunc &F: LinkingData.InitFunctions)
W.startLine() << F.FunctionIndex << " (priority=" << F.Priority
<< ")\n";
}
}
break;
case wasm::WASM_SEC_DATA: {