COFF: ARM: Fix DLL import table.

The previous test was testing -flavor link. This patch correctly
tests link2 and fixes a bug that we didn't emit import thunks.

llvm-svn: 243559
This commit is contained in:
Rui Ueyama 2015-07-29 19:24:58 +00:00
parent da1723f194
commit 56965f4b32
2 changed files with 8 additions and 11 deletions

View File

@ -200,14 +200,10 @@ DefinedImportThunk::DefinedImportThunk(StringRef Name, DefinedImportData *S,
uint16_t Machine)
: Defined(DefinedImportThunkKind, Name) {
switch (Machine) {
case AMD64:
Data.reset(new ImportThunkChunkX64(S));
return;
case I386:
Data.reset(new ImportThunkChunkX86(S));
return;
default:
llvm_unreachable("unknown machine type");
case AMD64: Data.reset(new ImportThunkChunkX64(S)); return;
case I386: Data.reset(new ImportThunkChunkX86(S)); return;
case ARMNT: Data.reset(new ImportThunkChunkARM(S)); return;
default: llvm_unreachable("unknown machine type");
}
}

View File

@ -1,11 +1,12 @@
# RUN: yaml2obj < %s > %t.obj
# RUN: lld -flavor link /out:%t.exe /subsystem:console %t.obj %p/Inputs/library.lib
# RUN: lld -flavor link2 /out:%t.exe /subsystem:console %t.obj \
# RUN: /entry:mainCRTStartup %p/Inputs/library.lib
# RUN: llvm-readobj -coff-imports %t.exe | FileCheck %s
# CHECK: Import {
# CHECK: Name: library.dll
# CHECK: ImportLookupTableRVA: 0x4000
# CHECK: ImportAddressTableRVA: 0x2000
# CHECK: ImportLookupTableRVA: 0x2028
# CHECK: ImportAddressTableRVA: 0x2030
# CHECK: Symbol: function (0)
# CHECK: }