[llvm-objdump] Update error message and add test case for mach-o file with bad library ordinals

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219746 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Kledzik 2014-10-14 23:29:38 +00:00
parent 2bddd7cf65
commit 1a0afd82b1
3 changed files with 7 additions and 1 deletions

Binary file not shown.

View File

@ -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

View File

@ -2802,7 +2802,7 @@ static StringRef ordinalName(const object::MachOObjectFile *Obj, int Ordinal) {
std::error_code EC = Obj->getLibraryShortNameByIndex(Ordinal-1,
DylibName);
if (EC)
return "<<ordinal too big>>";
return "<<bad library ordinal>>";
return DylibName;
}
}