HomePhabricator

[llvm-readobj] - Don't crash when dumping invalid dynamic relocation.

Authored by grimar on Jan 28 2020, 7:29 AM.

Description

[llvm-readobj] - Don't crash when dumping invalid dynamic relocation.

Currently when we dump dynamic relocation with use of
DT_RELA/DT_RELASZ/DT_RELAENT tags, we crash when a symbol index
is larger than the number of dynamic symbols or
when there is no dynamic symbol table.

This patch adds test cases and fixes the issues.

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