diff options
author | Michael Trent <mtrent@apple.com> | 2019-02-23 06:19:56 +0000 |
---|---|---|
committer | Michael Trent <mtrent@apple.com> | 2019-02-23 06:19:56 +0000 |
commit | 7dcfac617122976154ee39a8761147c5ff8ce1d9 (patch) | |
tree | 5443aa682b070697977395855f5227c2c9740e40 /clang/lib/Frontend/InitHeaderSearch.cpp | |
parent | 6c664eda780454f18385f8d39cde4fab7773529e (diff) | |
download | bcm5719-llvm-7dcfac617122976154ee39a8761147c5ff8ce1d9.tar.gz bcm5719-llvm-7dcfac617122976154ee39a8761147c5ff8ce1d9.zip |
objdump fails to parse Mach-O binaries with n_desc bearing stabs
Summary:
The objdump Mach-O parser uses MachOObjectFile::checkSymbolTable() to
verify the symbol table is in a legal state before dereferencing the
offsets in the table. This routine missed a test for N_STAB symbols
when validating the two-level name space library ordinal for undefined
symbols. If the binary in question contained a value in the n_desc high
byte that is larger than the list of loaded dylibs, checkSymbolTable()
will flag the library ordinal as being out of range. Most of the time
the n_desc field is set to 0 or to small values, but old final linked
binaries exist with N_STAB symbols bearing non-trivial n_desc fields.
The change here is simply to verify a symbol is not an N_STAB symbol
before consulting the values of n_other or n_desc.
rdar://44977336
Reviewers: lhames, pete, ab
Reviewed By: pete
Subscribers: llvm-commits, rupprecht
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58568
llvm-svn: 354722
Diffstat (limited to 'clang/lib/Frontend/InitHeaderSearch.cpp')
0 files changed, 0 insertions, 0 deletions