1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

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
This commit is contained in:
Saleem Abdulrasool 2016-08-18 14:32:11 +00:00
parent 9d01e3d349
commit 1cd17d17bc
3 changed files with 24 additions and 0 deletions

Binary file not shown.

View File

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

View File

@ -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);
}