This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Enable llvm-objdump to decide target triple for ARM
AbandonedPublic

Authored by samparker on Oct 21 2016, 4:00 AM.

Details

Reviewers
None
Summary

I've moved the ARM build attribute parsing code out of llvm-readobj and into the support library (although maybe this should be in Object). On the creation of an ELFFileObject, the attributes are parsed if they exist. The parser has been modified to store all the attributes as it goes, and I've added numerous getter functions.

The ELFFileObject now also provides a function to try to decide the target triple to use from the build attributes, and there is now also a getFeatures() function for ARM. llvm-objdump uses these functions to setup the target triple, if a subarch isn't provided, as well as the subtarget features.

Diff Detail

Event Timeline

samparker updated this revision to Diff 75409.Oct 21 2016, 4:00 AM
samparker retitled this revision from to [ARM] Enable llvm-objdump to decide target triple for ARM.
samparker updated this object.
samparker added a reviewer: llvm-commits.

Hi Sam,

I think there are too many changes in this review: Moving the parser to lib/Support, adding getters, adding arm/thumb logic to the object file, adding a lot of new logic to the existing functions and not many tests to cover the big changes.

I think you should split this into multiple patches:

  1. Move to lib/Support
  2. Add setARMSubArch and only related logic, add tests
  3. Refine the object attributes in llvm-objects, add tests
  4. Improve getters/setters, add tests for the new functionality

cheers,
--renato

Thanks Renato, that sounds perfectly reasonable to me. I will get to it.

samparker abandoned this revision.Jan 18 2017, 2:21 PM
tools/llvm-readobj/ARMAttributeParser.h