From 1d14864bb35b011d1a1cd08a7c3c033ef87bde42 Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Thu, 16 Jun 2016 09:17:03 +0000 Subject: [llvm-objdump] Support detection of feature bits from the object and implement this for Mips. Summary: The Mips implementation only covers the feature bits described by the ELF e_flags so far. Mips stores additional feature bits such as MSA in the .MIPS.abiflags section. Also fixed a small bug this revealed where microMIPS wouldn't add the EF_MIPS_MICROMIPS flag when using -filetype=obj. Reviewers: echristo, rafael Subscribers: rafael, mehdi_amini, dsanders, sdardis, llvm-commits Differential Revision: http://reviews.llvm.org/D21125 llvm-svn: 272880 --- llvm/tools/llvm-objdump/llvm-objdump.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/tools/llvm-objdump') diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 38550b91530..3beb01ad6eb 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -931,12 +931,10 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { const Target *TheTarget = getTarget(Obj); // Package up features to be passed to target/subtarget - std::string FeaturesStr; + SubtargetFeatures Features = Obj->getFeatures(); if (MAttrs.size()) { - SubtargetFeatures Features; for (unsigned i = 0; i != MAttrs.size(); ++i) Features.AddFeature(MAttrs[i]); - FeaturesStr = Features.getString(); } std::unique_ptr MRI( @@ -950,7 +948,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { if (!AsmInfo) report_fatal_error("error: no assembly info for target " + TripleName); std::unique_ptr STI( - TheTarget->createMCSubtargetInfo(TripleName, MCPU, FeaturesStr)); + TheTarget->createMCSubtargetInfo(TripleName, MCPU, Features.getString())); if (!STI) report_fatal_error("error: no subtarget info for target " + TripleName); std::unique_ptr MII(TheTarget->createMCInstrInfo()); -- cgit v1.2.3