diff options
author | Tim Northover <tnorthover@apple.com> | 2016-07-14 22:13:32 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2016-07-14 22:13:32 +0000 |
commit | f203ab5be38163cd2c561f64c0453acf22978a0b (patch) | |
tree | ea132699089bf297913c24a4ed9082b6b5370587 /llvm/test | |
parent | 85be3afda446191527ff7bb8009e1b96a15b8f9c (diff) | |
download | bcm5719-llvm-f203ab5be38163cd2c561f64c0453acf22978a0b.tar.gz bcm5719-llvm-f203ab5be38163cd2c561f64c0453acf22978a0b.zip |
llvm-objdump: handle stubbed and malformed dylibs better
We were quite happy to read past the end of the valid section data when
disassembling. Instead we entirely skip stub dylibs, and tell the user what's
happened if their section only has partial data.
llvm-svn: 275487
Diffstat (limited to 'llvm/test')
-rwxr-xr-x | llvm/test/tools/llvm-objdump/X86/Inputs/stubbed.dylib.macho-x86_64 | bin | 0 -> 784 bytes | |||
-rwxr-xr-x | llvm/test/tools/llvm-objdump/X86/Inputs/truncated-section.dylib.macho-x86_64 | bin | 0 -> 4208 bytes | |||
-rw-r--r-- | llvm/test/tools/llvm-objdump/X86/stubbed-dylib.test | 5 | ||||
-rw-r--r-- | llvm/test/tools/llvm-objdump/X86/truncated-section.test | 7 |
4 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objdump/X86/Inputs/stubbed.dylib.macho-x86_64 b/llvm/test/tools/llvm-objdump/X86/Inputs/stubbed.dylib.macho-x86_64 Binary files differnew file mode 100755 index 00000000000..144738bc97d --- /dev/null +++ b/llvm/test/tools/llvm-objdump/X86/Inputs/stubbed.dylib.macho-x86_64 diff --git a/llvm/test/tools/llvm-objdump/X86/Inputs/truncated-section.dylib.macho-x86_64 b/llvm/test/tools/llvm-objdump/X86/Inputs/truncated-section.dylib.macho-x86_64 Binary files differnew file mode 100755 index 00000000000..a099ee2d379 --- /dev/null +++ b/llvm/test/tools/llvm-objdump/X86/Inputs/truncated-section.dylib.macho-x86_64 diff --git a/llvm/test/tools/llvm-objdump/X86/stubbed-dylib.test b/llvm/test/tools/llvm-objdump/X86/stubbed-dylib.test new file mode 100644 index 00000000000..6f7f7221eb1 --- /dev/null +++ b/llvm/test/tools/llvm-objdump/X86/stubbed-dylib.test @@ -0,0 +1,5 @@ +RUN: llvm-objdump -macho -d %p/Inputs/stubbed.dylib.macho-x86_64 | FileCheck %s + +CHECK: (__TEXT,__text) section +CHECK-NOT: func +CHECK-NOT: func2 diff --git a/llvm/test/tools/llvm-objdump/X86/truncated-section.test b/llvm/test/tools/llvm-objdump/X86/truncated-section.test new file mode 100644 index 00000000000..e9fe75da71a --- /dev/null +++ b/llvm/test/tools/llvm-objdump/X86/truncated-section.test @@ -0,0 +1,7 @@ +RUN: llvm-objdump -macho -d %p/Inputs/truncated-section.dylib.macho-x86_64 | FileCheck %s + +CHECK: _func: +CHECK: retq +CHECK: retq + +CHECK: section data ends, _func2 lies outside valid range |