aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-readobj/llvm-readobj.cpp
diff options
context:
space:
mode:
authorGeorgii Rymar <grimar@accesssoftek.com>2020-05-13 15:06:01 +0300
committerGeorgii Rymar <grimar@accesssoftek.com>2020-05-15 11:33:23 +0300
commit56970ec6a0bed5ba4312872eed13137ca43f67fb (patch)
treeef96ff16170f312e725f5ea60f9a37b1482074ed /llvm/tools/llvm-readobj/llvm-readobj.cpp
parent7ccae2cece72153d2c8210ef916bf0052da216ad (diff)
downloadllvm-56970ec6a0bed5ba4312872eed13137ca43f67fb.zip
llvm-56970ec6a0bed5ba4312872eed13137ca43f67fb.tar.gz
llvm-56970ec6a0bed5ba4312872eed13137ca43f67fb.tar.bz2
[llvm-readobj] - --gnu-hash-table: do not crash when the GNU hash table goes past the EOF.
We might have a scenario where a the `GbuHashTable` variable correctly points to a place inside the file (we validate this fact early in `parseDynamicTable`), but nbuckets/maskwords fields are broken in the way the code tries to read the data past the EOF. This patch fixes the issue. Differential revision: https://reviews.llvm.org/D79853
Diffstat (limited to 'llvm/tools/llvm-readobj/llvm-readobj.cpp')
-rw-r--r--llvm/tools/llvm-readobj/llvm-readobj.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-readobj/llvm-readobj.cpp b/llvm/tools/llvm-readobj/llvm-readobj.cpp
index e87031f..8540938 100644
--- a/llvm/tools/llvm-readobj/llvm-readobj.cpp
+++ b/llvm/tools/llvm-readobj/llvm-readobj.cpp
@@ -489,7 +489,7 @@ static void dumpObject(const ObjectFile *Obj, ScopedPrinter &Writer,
if (opts::HashTable)
Dumper->printHashTable();
if (opts::GnuHashTable)
- Dumper->printGnuHashTable();
+ Dumper->printGnuHashTable(Obj);
if (opts::VersionInfo)
Dumper->printVersionInfo();
if (Obj->isELF()) {