[PATCH] D89379: [llvm-readobj/libObject] - Allow dumping objects that has a broken SHT_SYMTAB_SHNDX section.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 02:37:38 PDT 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added subscribers: rupprecht, mgorny, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
grimar requested review of this revision.

Currently it is impossible to create an instance of `ELFObjectFile` when the
`SHT_SYMTAB_SHNDX` can't be read. It happens because `ELFObjectFile` tries to
read its entries too early, in the constructor.

This change delays reading of the `SHT_SYMTAB_SHNDX` section entries,
with it llvm-readobj is now able to work with such inputs.


https://reviews.llvm.org/D89379

Files:
  llvm/include/llvm/Object/ELFObjectFile.h
  llvm/test/Object/invalid.test
  llvm/test/tools/llvm-readobj/ELF/symbol-shndx.test
  llvm/test/tools/obj2yaml/ELF/sht-symtab-shndx.yaml
  llvm/test/tools/yaml2obj/ELF/sht-symtab-shndx.yaml
  llvm/tools/llvm-readobj/ELFDumper.cpp
  llvm/unittests/Object/CMakeLists.txt
  llvm/unittests/Object/ELFObjectFileTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89379.298089.patch
Type: text/x-patch
Size: 11483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201014/6603ce55/attachment.bin>


More information about the llvm-commits mailing list