[llvm-readelf] - Rework how we parse the .dynamic section.
authorGeorge Rimar <grimar@accesssoftek.com>
Mon, 20 May 2019 15:41:48 +0000 (15:41 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Mon, 20 May 2019 15:41:48 +0000 (15:41 +0000)
commit72f821d3de05448e71bff7b39d3e4993c447882a
tree1eb6c4cca48be0b0a5210287c229fb1013e66754
parent055906e1e50ddc35d6c8cdccab48ed83e93b47eb
[llvm-readelf] - Rework how we parse the .dynamic section.

This is a result of what I found during my work on https://bugs.llvm.org/show_bug.cgi?id=41679.

Previously LLVM readelf took the information about .dynamic section
from its PT_DYNAMIC segment only. GNU tools have a bit different logic.
They also use the information from the .dynamic section header if it is available.
This patch changes the code to improve the compatibility with the GNU Binutils.

Differential revision: https://reviews.llvm.org/D61937

llvm-svn: 361165
llvm/test/Object/Inputs/corrupt-invalid-dynamic-table-size.elf.x86-64
llvm/test/Object/corrupt.test
llvm/test/tools/llvm-readobj/elf-dynamic-not-in-pt-dynamic.test [new file with mode: 0644]
llvm/test/tools/llvm-readobj/elf-malformed-pt-dynamic.test
llvm/test/tools/llvm-readobj/elf-non-dynamic-in-pt-dynamic.test [new file with mode: 0644]
llvm/tools/llvm-readobj/ELFDumper.cpp
llvm/tools/llvm-readobj/llvm-readobj.cpp
llvm/tools/llvm-readobj/llvm-readobj.h