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

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 25 20:41:18 PDT 2018


compnerd added a comment.

I'd actually like to echo @ruiu's comment here.  I don't think that ELF has much to gain from the textual representation (unlike MachO).  ELF doesn't have the fat binary support, so you cannot really collapse multiple slices into a single slice and only mark differences in the slices from a common base.  Furthermore, by exploiting the fact that ELF is extremely flexible in terms of what it considers a valid object, we can actually limit a stub to just the symbol table and the ELF header I believe.  This is going to be a few extra bytes for the fields in the ELF header that we don't care about (e.g. magic).  Since the majority of the binary will be the string table, I expect it to compress pretty well and be roughly in the same area as a textual representation.  One added benefit of such an approach is that it is retroactively compatible with existing linkers.  They should accept the output even though the binary would not be usable to run!

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D53051





More information about the llvm-commits mailing list