]> granicus.if.org Git - llvm/commitdiff
[llvm-readobj] Dump wasm init functions
authorSam Clegg <sbc@chromium.org>
Tue, 19 Dec 2017 00:04:41 +0000 (00:04 +0000)
committerSam Clegg <sbc@chromium.org>
Tue, 19 Dec 2017 00:04:41 +0000 (00:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321042 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-readobj/WasmDumper.cpp

index 77711e749aa09e4dff273ba71686a90f971a3d8e..223c1c752469efda14e494d2d5f5cdbd166abc7a 100644 (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: {