From: Nick Kledzik Date: Tue, 14 Oct 2014 23:29:38 +0000 (+0000) Subject: [llvm-objdump] Update error message and add test case for mach-o file with bad librar... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1a0afd82b1f5e1f4e31f58f5323f5032d24be86c;p=oota-llvm.git [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 --- diff --git a/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 b/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 new file mode 100755 index 00000000000..3ab622781b8 Binary files /dev/null and b/test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 differ diff --git a/test/tools/llvm-objdump/macho-bad-ordinal.test b/test/tools/llvm-objdump/macho-bad-ordinal.test new file mode 100644 index 00000000000..16badcc878d --- /dev/null +++ b/test/tools/llvm-objdump/macho-bad-ordinal.test @@ -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 <> dyld_stub_binder +# CHECK: __DATA __la_symbol_ptr 0x100001010 <> _printf diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index f4cd08b039f..c881ccd874f 100644 --- a/tools/llvm-objdump/MachODump.cpp +++ b/tools/llvm-objdump/MachODump.cpp @@ -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 "<>"; + return "<>"; return DylibName; } }