[llvm] r321042 - [llvm-readobj] Dump wasm init functions

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 16:04:41 PST 2017


Author: sbc
Date: Mon Dec 18 16:04:41 2017
New Revision: 321042

URL: http://llvm.org/viewvc/llvm-project?rev=321042&view=rev
Log:
[llvm-readobj] Dump wasm init functions

Modified:
    llvm/trunk/tools/llvm-readobj/WasmDumper.cpp

Modified: llvm/trunk/tools/llvm-readobj/WasmDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/WasmDumper.cpp?rev=321042&r1=321041&r2=321042&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/WasmDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/WasmDumper.cpp Mon Dec 18 16:04:41 2017
@@ -100,8 +100,8 @@ void WasmDumper::printRelocation(const S
       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: {




More information about the llvm-commits mailing list