[PATCH] D99399: [elfabi] Prepare llvm-elfabi for elfabi/ifs merging.

Haowei Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 25 21:58:46 PDT 2021


haowei created this revision.
haowei added reviewers: phosek, mcgrathr, plotfi, compnerd.
Herald added a subscriber: hiraditya.
haowei requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This change implements unified text stub format and command line interface proposed in the elfabi/ifs merge plan (https://lists.llvm.org/pipermail/llvm-dev/2021-March/149263.html). This CL mainly serves the purpose of verifying the ideas proposed in the merge plan. Once it lands, the next step will be update the clang IFSO driver and llvm-ifs to generate the text stub in the same format and performs the actual merging.

I ran into a lot of issues with LLVM's yaml library. It does not allow using ScalarTraits on Optional<uint16_t> type. It also does not allow mapping 2 traits on the same type, creating a lot of difficulties to support both `Target: triple_string` and `Target: { Arch:..., Endianness: ...} ` in the same data structure.  Please let me know if you have better workarounds than the one I used in this change.

When updating ifs tool with the unified text stub and command line interfacing, I plan to rename 'ELFStub.h' to 'InterfaceStub.h'  'TBEHandler.cpp' to 'IFSHandler.cpp' as these 2 will cover formats like TBD and COEF in the future. The naming of 'ELFObjHandler.h' will remans the same since it still only covers ELF related operations. Please let me know if you have any suggestions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99399

Files:
  llvm/include/llvm/InterfaceStub/ELFObjHandler.h
  llvm/include/llvm/InterfaceStub/ELFStub.h
  llvm/include/llvm/InterfaceStub/TBEHandler.h
  llvm/lib/InterfaceStub/ELFObjHandler.cpp
  llvm/lib/InterfaceStub/ELFStub.cpp
  llvm/lib/InterfaceStub/TBEHandler.cpp
  llvm/test/tools/llvm-elfabi/binary-read-add-soname.test
  llvm/test/tools/llvm-elfabi/binary-read-arch.test
  llvm/test/tools/llvm-elfabi/binary-read-bad-soname.test
  llvm/test/tools/llvm-elfabi/binary-read-bad-vaddr.test
  llvm/test/tools/llvm-elfabi/binary-read-neededlibs-bad-offset.test
  llvm/test/tools/llvm-elfabi/binary-read-neededlibs.test
  llvm/test/tools/llvm-elfabi/binary-read-no-dt-strsz.test
  llvm/test/tools/llvm-elfabi/binary-read-no-dt-strtab.test
  llvm/test/tools/llvm-elfabi/binary-read-no-dynamic.test
  llvm/test/tools/llvm-elfabi/binary-read-replace-soname.test
  llvm/test/tools/llvm-elfabi/binary-read-soname-no-null.test
  llvm/test/tools/llvm-elfabi/binary-read-soname.test
  llvm/test/tools/llvm-elfabi/binary-read-syms-gnu-hash.test
  llvm/test/tools/llvm-elfabi/binary-read-syms-sysv-hash.test
  llvm/test/tools/llvm-elfabi/fail-file-open.test
  llvm/test/tools/llvm-elfabi/fail-file-write-windows.test
  llvm/test/tools/llvm-elfabi/fail-file-write.test
  llvm/test/tools/llvm-elfabi/output-target-error.test
  llvm/test/tools/llvm-elfabi/preserve-dates-stub.test
  llvm/test/tools/llvm-elfabi/preserve-dates-tbe.test
  llvm/test/tools/llvm-elfabi/read-elf-dynsym.test
  llvm/test/tools/llvm-elfabi/read-tbe-as-elf.test
  llvm/test/tools/llvm-elfabi/read-tbe-as-tbe.test
  llvm/test/tools/llvm-elfabi/read-unsupported-file.test
  llvm/test/tools/llvm-elfabi/strip-target.test
  llvm/test/tools/llvm-elfabi/tbe-emits-current-version.test
  llvm/test/tools/llvm-elfabi/tbe-read-basic.test
  llvm/test/tools/llvm-elfabi/write-stub-no-nonlocal-symbol.test
  llvm/test/tools/llvm-elfabi/write-stub.test
  llvm/tools/llvm-elfabi/llvm-elfabi.cpp
  llvm/tools/llvm-ifs/llvm-ifs.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99399.333496.patch
Type: text/x-patch
Size: 67445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210326/0e90aeba/attachment.bin>


More information about the llvm-commits mailing list