[llvm] r294021 - Fix a bug in llvm-obdump(1) with the -objc-meta-data flag with -macho
Kevin Enderby via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 3 10:22:05 PST 2017
Author: enderby
Date: Fri Feb 3 12:22:04 2017
New Revision: 294021
URL: http://llvm.org/viewvc/llvm-project?rev=294021&view=rev
Log:
Fix a bug in llvm-obdump(1) with the -objc-meta-data flag with -macho
which caused a hang on a malformed binary with bad bind info.
rdar://29672108
Added:
llvm/trunk/test/tools/llvm-objdump/X86/Inputs/macho-invalid-bind-entry (with props)
Modified:
llvm/trunk/test/tools/llvm-objdump/X86/malformed-machos.test
llvm/trunk/tools/llvm-objdump/MachODump.cpp
Added: llvm/trunk/test/tools/llvm-objdump/X86/Inputs/macho-invalid-bind-entry
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/Inputs/macho-invalid-bind-entry?rev=294021&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/tools/llvm-objdump/X86/Inputs/macho-invalid-bind-entry
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: llvm/trunk/test/tools/llvm-objdump/X86/malformed-machos.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/malformed-machos.test?rev=294021&r1=294020&r2=294021&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/malformed-machos.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/malformed-machos.test Fri Feb 3 12:22:04 2017
@@ -63,3 +63,6 @@ INVALID-SYMBOL-STRX-UNIVERSAL: macho-inv
RUN: not llvm-objdump -macho -disassemble %p/Inputs/macho-invalid-symbol-lib_ordinal 2>&1 | FileCheck -check-prefix INVALID-SYMBOL-LIB_ORDINAL %s
INVALID-SYMBOL-LIB_ORDINAL: macho-invalid-symbol-lib_ordinal': truncated or malformed object (bad library ordinal: 7 for symbol at index 2)
+
+RUN: llvm-objdump -macho -objc-meta-data %p/Inputs/macho-invalid-bind-entry | FileCheck -check-prefix INVALID-BIND-ENTRY %s
+INVALID-BIND-ENTRY: 0000000100020c90 0x2d0409887202e473
Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=294021&r1=294020&r2=294021&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Fri Feb 3 12:22:04 2017
@@ -9579,7 +9579,7 @@ static const char *get_dyld_bind_info_sy
uint32_t SegIndex = Entry.segmentIndex();
uint64_t OffsetInSeg = Entry.segmentOffset();
if (!sectionTable.isValidSegIndexAndOffset(SegIndex, OffsetInSeg))
- continue;
+ return nullptr;
uint64_t Address = sectionTable.address(SegIndex, OffsetInSeg);
StringRef name = Entry.symbolName();
if (!name.empty())
More information about the llvm-commits
mailing list