From c46ea19bd32e04dbf3cd2fd5db1c60a7d3ec6814 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Fri, 24 Jul 2015 02:14:20 +0000 Subject: [PATCH] [llvm-reaobj] Display COFF-specific sections/tables only if the object is COFF. Just skip them otherwise. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243086 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-readobj/llvm-readobj.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/llvm-readobj/llvm-readobj.cpp b/tools/llvm-readobj/llvm-readobj.cpp index f0956f8c63e..db0ffd0141a 100644 --- a/tools/llvm-readobj/llvm-readobj.cpp +++ b/tools/llvm-readobj/llvm-readobj.cpp @@ -302,15 +302,16 @@ static void dumpObject(const ObjectFile *Obj) { if (opts::MipsReginfo) Dumper->printMipsReginfo(); } - if (opts::COFFImports) - Dumper->printCOFFImports(); - if (opts::COFFExports) - Dumper->printCOFFExports(); - if (opts::COFFDirectives) - Dumper->printCOFFDirectives(); - if (opts::COFFBaseRelocs) - Dumper->printCOFFBaseReloc(); - + if (Obj->isCOFF()) { + if (opts::COFFImports) + Dumper->printCOFFImports(); + if (opts::COFFExports) + Dumper->printCOFFExports(); + if (opts::COFFDirectives) + Dumper->printCOFFDirectives(); + if (opts::COFFBaseRelocs) + Dumper->printCOFFBaseReloc(); + } if (opts::PrintStackMap) Dumper->printStackMap(); } -- 2.34.1