[WebAssembly] Add more details to llvm-readobj for wasm files

Differential Revision: https://reviews.llvm.org/D35208

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307588 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sam Clegg 2017-07-10 20:47:12 +00:00
parent 581e763cd4
commit f3f79378e0
2 changed files with 8 additions and 0 deletions

View File

@ -561,5 +561,7 @@ WASM-NEXT: Type: CUSTOM (0x0)
WASM-NEXT: Size: 22
WASM-NEXT: Offset: 257
WASM-NEXT: Name: linking
WASM-NEXT: DataSize: 13
WASM-NEXT: DataAlignment: 1
WASM-NEXT: }
WASM-NEXT: ]

View File

@ -153,6 +153,12 @@ void WasmDumper::printSections() {
switch (WasmSec.Type) {
case wasm::WASM_SEC_CUSTOM:
W.printString("Name", WasmSec.Name);
if (WasmSec.Name == "linking") {
const wasm::WasmLinkingData &LinkingData = Obj->linkingData();
W.printNumber("DataSize", LinkingData.DataSize);
if (LinkingData.DataAlignment)
W.printNumber("DataAlignment", LinkingData.DataAlignment);
}
break;
case wasm::WASM_SEC_MEMORY:
ListScope Group(W, "Memories");