summaryrefslogtreecommitdiffstats
path: root/lld/COFF/Chunks.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-09-26 06:13:39 +0000
committerMartin Storsjo <martin@martin.st>2018-09-26 06:13:39 +0000
commit2bfa125fd653878324cc3b447d84ec1c2e3fe93d (patch)
treea35c8dd062798a171fed2c0796d4ae8430fe5a3b /lld/COFF/Chunks.cpp
parent8fafd33a3c309748d0dcbbd264f7dc7d7d1917b0 (diff)
downloadbcm5719-llvm-2bfa125fd653878324cc3b447d84ec1c2e3fe93d.tar.gz
bcm5719-llvm-2bfa125fd653878324cc3b447d84ec1c2e3fe93d.zip
[COFF] Allow automatic dllimport from gnu import libraries
Don't assume that the IAT chunk will be a DefinedImportData, it can just as well be a DefinedRegular for gnu import libraries. Differential Revision: https://reviews.llvm.org/D52381 llvm-svn: 343069
Diffstat (limited to 'lld/COFF/Chunks.cpp')
-rw-r--r--lld/COFF/Chunks.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp
index 52d42af739e..dc471117981 100644
--- a/lld/COFF/Chunks.cpp
+++ b/lld/COFF/Chunks.cpp
@@ -529,8 +529,8 @@ static int getRuntimePseudoRelocSize(uint16_t Type) {
void SectionChunk::getRuntimePseudoRelocs(
std::vector<RuntimePseudoReloc> &Res) {
for (const coff_relocation &Rel : Relocs) {
- auto *Target = dyn_cast_or_null<DefinedImportData>(
- File->getSymbol(Rel.SymbolTableIndex));
+ auto *Target =
+ dyn_cast_or_null<Defined>(File->getSymbol(Rel.SymbolTableIndex));
if (!Target || !Target->IsRuntimePseudoReloc)
continue;
int SizeInBits = getRuntimePseudoRelocSize(Rel.Type);
OpenPOWER on IntegriCloud