[llvm-readobj] Fallback to PT_NOTE if file doesn't have sections
authorPetr Hosek <phosek@chromium.org>
Fri, 16 Aug 2019 23:15:40 +0000 (23:15 +0000)
committerPetr Hosek <phosek@chromium.org>
Fri, 16 Aug 2019 23:15:40 +0000 (23:15 +0000)
commit7da81b5e4d2b9cb389cff28c1cc144abcf986f66
tree60629abde72c19578e719ed9d2b2f77fbf431e50
parentacceedb15f52108d0e36d8090cb25fcdf34a4fc1
[llvm-readobj] Fallback to PT_NOTE if file doesn't have sections

This is useful when trying to read notes from stripped files and matches
the behavior of GNU readelf and eu-readelf.

Differential Revision: https://reviews.llvm.org/D66358

llvm-svn: 369169
llvm/test/tools/llvm-readobj/gnu-notes.test
llvm/tools/llvm-readobj/ELFDumper.cpp