summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2016-06-16 09:17:03 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2016-06-16 09:17:03 +0000
commit1d14864bb35b011d1a1cd08a7c3c033ef87bde42 (patch)
treeaf265742beed843f53465a16a991d38bd08128fb /llvm/tools/llvm-objdump/llvm-objdump.cpp
parent139ffba398645de7fd3a98eb581c6a79340b67b2 (diff)
downloadbcm5719-llvm-1d14864bb35b011d1a1cd08a7c3c033ef87bde42.tar.gz
bcm5719-llvm-1d14864bb35b011d1a1cd08a7c3c033ef87bde42.zip
[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
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp6
1 files changed, 2 insertions, 4 deletions
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<const MCRegisterInfo> 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<const MCSubtargetInfo> 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<const MCInstrInfo> MII(TheTarget->createMCInstrInfo());
OpenPOWER on IntegriCloud