[lld] r243559 - COFF: ARM: Fix DLL import table.
Rui Ueyama
ruiu at google.com
Wed Jul 29 12:24:58 PDT 2015
Author: ruiu
Date: Wed Jul 29 14:24:58 2015
New Revision: 243559
URL: http://llvm.org/viewvc/llvm-project?rev=243559&view=rev
Log:
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.
Modified:
lld/trunk/COFF/Symbols.cpp
lld/trunk/test/COFF/armnt-imports.test
Modified: lld/trunk/COFF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Symbols.cpp?rev=243559&r1=243558&r2=243559&view=diff
==============================================================================
--- lld/trunk/COFF/Symbols.cpp (original)
+++ lld/trunk/COFF/Symbols.cpp Wed Jul 29 14:24:58 2015
@@ -200,14 +200,10 @@ DefinedImportThunk::DefinedImportThunk(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");
}
}
Modified: lld/trunk/test/COFF/armnt-imports.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/armnt-imports.test?rev=243559&r1=243558&r2=243559&view=diff
==============================================================================
--- lld/trunk/test/COFF/armnt-imports.test (original)
+++ lld/trunk/test/COFF/armnt-imports.test Wed Jul 29 14:24:58 2015
@@ -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: }
More information about the llvm-commits
mailing list