[PATCH] D53051: [llvm-tapi] initial commit, supports reading ELF

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 26 08:35:24 PDT 2018


ruiu added a comment.

> As to your point of having an easy to verify mechanism for validating the ABI/API of an ELF Object, I think that such a tool would be immensely useful.  However, I think that there is a much nicer approach for this: `llvm-nm` with a `-format llvm` or `-format json` or `-format yaml` which provides the information that is needed for the ABI/API verification in a machine readable format.  The name tool already has all the functionality needed for this, and is binary format agnostic, making this useful on any target even without any additional work.

I agree with that point. Defining a text format for a ELF stub should be useful, but that can be done as a feature of a single LLVM tool. I believe it is not too hard to add a feature to `llvm-nm` so that the tool can convert a binary ELF stub to a textual representation of it or vice versa. Looks like that should give you all the benefits you mentioned, such as it allows you to check in a text file instead of a binary, and it seems that it is much more lightweight than defining a new textual file format as a cross-tool or even an industry-standard format, implement the new file format support as a library, and use that library from various tools.


Repository:
  rL LLVM

https://reviews.llvm.org/D53051





More information about the llvm-commits mailing list