[llvm] r219746 - [llvm-objdump] Update error message and add test case for mach-o file with bad library ordinals
Nick Kledzik
kledzik at apple.com
Tue Oct 14 16:29:38 PDT 2014
Author: kledzik
Date: Tue Oct 14 18:29:38 2014
New Revision: 219746
URL: http://llvm.org/viewvc/llvm-project?rev=219746&view=rev
Log:
[llvm-objdump] Update error message and add test case for mach-o file with bad library ordinals
Added:
llvm/trunk/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 (with props)
llvm/trunk/test/tools/llvm-objdump/macho-bad-ordinal.test
Modified:
llvm/trunk/tools/llvm-objdump/MachODump.cpp
Added: llvm/trunk/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64?rev=219746&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64
------------------------------------------------------------------------------
svn:executable = *
Propchange: llvm/trunk/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: llvm/trunk/test/tools/llvm-objdump/macho-bad-ordinal.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/macho-bad-ordinal.test?rev=219746&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/macho-bad-ordinal.test (added)
+++ llvm/trunk/test/tools/llvm-objdump/macho-bad-ordinal.test Tue Oct 14 18:29:38 2014
@@ -0,0 +1,6 @@
+# RUN: llvm-objdump -macho -bind -lazy-bind %p/Inputs/bad-ordinal.macho-x86_64 \
+# RUN: | FileCheck %s
+
+
+# CHECK: __DATA __nl_symbol_ptr 0x100001000 pointer 0 <<bad library ordinal>> dyld_stub_binder
+# CHECK: __DATA __la_symbol_ptr 0x100001010 <<bad library ordinal>> _printf
Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=219746&r1=219745&r2=219746&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Tue Oct 14 18:29:38 2014
@@ -2802,7 +2802,7 @@ static StringRef ordinalName(const objec
std::error_code EC = Obj->getLibraryShortNameByIndex(Ordinal-1,
DylibName);
if (EC)
- return "<<ordinal too big>>";
+ return "<<bad library ordinal>>";
return DylibName;
}
}
More information about the llvm-commits
mailing list