diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-18 14:32:11 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-18 14:32:11 +0000 |
| commit | 3780b3a9eb6a51ab2ced55bda20b315d7817221d (patch) | |
| tree | f36675af6d98bb008231827fa7454d07b1782e04 /llvm | |
| parent | 7d37b221a2ff836dc18a27615cf3968716b0819d (diff) | |
| download | bcm5719-llvm-3780b3a9eb6a51ab2ced55bda20b315d7817221d.tar.gz bcm5719-llvm-3780b3a9eb6a51ab2ced55bda20b315d7817221d.zip | |
llvm-readobj: handle import libraries with -coff-exports
`link -dump -exports` lists exported symbols from import libraries as well as
normal dlls. Ensure that we can handle import libraries as well in
llvm-readobj.
llvm-svn: 279069
Diffstat (limited to 'llvm')
| -rwxr-xr-x | llvm/test/tools/llvm-readobj/Inputs/library.lib | bin | 0 -> 2166 bytes | |||
| -rw-r--r-- | llvm/test/tools/llvm-readobj/coff-exports-implib.test | 22 | ||||
| -rw-r--r-- | llvm/tools/llvm-readobj/llvm-readobj.cpp | 2 |
3 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-readobj/Inputs/library.lib b/llvm/test/tools/llvm-readobj/Inputs/library.lib Binary files differnew file mode 100755 index 00000000000..193380dd485 --- /dev/null +++ b/llvm/test/tools/llvm-readobj/Inputs/library.lib diff --git a/llvm/test/tools/llvm-readobj/coff-exports-implib.test b/llvm/test/tools/llvm-readobj/coff-exports-implib.test new file mode 100644 index 00000000000..9715109b3d5 --- /dev/null +++ b/llvm/test/tools/llvm-readobj/coff-exports-implib.test @@ -0,0 +1,22 @@ +RUN: llvm-readobj -coff-exports %p/Inputs/library.lib | FileCheck %s + +CHECK: File: library.dll +CHECK: Format: COFF-import-file +CHECK: Type: const +CHECK: Symbol: __imp__constant + +CHECK: File: library.dll +CHECK: Format: COFF-import-file +CHECK: Type: data +CHECK: Symbol: __imp__data + +CHECK: File: library.dll +CHECK: Format: COFF-import-file +CHECK: Type: code +CHECK: Symbol: __imp__function + +CHECK: File: library.dll +CHECK: Format: COFF-import-file +CHECK: Type: code +CHECK: Symbol: __imp__ordinal + diff --git a/llvm/tools/llvm-readobj/llvm-readobj.cpp b/llvm/tools/llvm-readobj/llvm-readobj.cpp index 14178b97609..d811ea995ba 100644 --- a/llvm/tools/llvm-readobj/llvm-readobj.cpp +++ b/llvm/tools/llvm-readobj/llvm-readobj.cpp @@ -460,6 +460,8 @@ static void dumpArchive(const Archive *Arc) { } if (ObjectFile *Obj = dyn_cast<ObjectFile>(&*ChildOrErr.get())) dumpObject(Obj); + else if (COFFImportFile *Imp = dyn_cast<COFFImportFile>(&*ChildOrErr.get())) + dumpCOFFImportFile(Imp); else reportError(Arc->getFileName(), readobj_error::unrecognized_file_format); } |

