This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Fix for branch label dissassembly for Thumb targets
ClosedPublic

Authored by avieira on Mar 14 2017, 8:07 AM.

Details

Summary

different MCInstrAnalysis classes for arm and thumb mode each with their own evaluateBranch implementation.

I added a test case and fixed the coff-relocations test to use '<label>:' rather than '<label>' in the CHECK-LABEL entries, since the ones without the colon would match branch targets. Might be worth noticing that llvm-objdump does not lookup the relocation and thus assigns it a target depending on the encoded immediate which is #0, so it thinks it branches to the next instruction.

Diff Detail

Repository
rL LLVM

Event Timeline

avieira created this revision.Mar 14 2017, 8:07 AM
samparker accepted this revision.Mar 14 2017, 10:32 AM

Hi Andre,

Thanks for working on this. It would be be nice to have isConditonalBranch and isUnconditionalBranch implemented but, there as there was no specific thumb handling previously, it can definitely wait. LGTM with just the small comment change, no need to re-review.

cheers,
sam

lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
279 ↗(On Diff #91728)

thumb mode

This revision is now accepted and ready to land.Mar 14 2017, 10:32 AM
This revision was automatically updated to reflect the committed changes.