diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2018-05-10 19:01:28 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-05-10 19:01:28 +0000 |
| commit | e28faed768aced512dd0679a3ef37c3c59c59f35 (patch) | |
| tree | b7d8b1485aa9860f259258330075968be79400cb /lld/COFF/Writer.cpp | |
| parent | 1a840d29b417e393c3d229706c912a97d015ed41 (diff) | |
| download | bcm5719-llvm-e28faed768aced512dd0679a3ef37c3c59c59f35.tar.gz bcm5719-llvm-e28faed768aced512dd0679a3ef37c3c59c59f35.zip | |
COFF: Don't create unnecessary thunks.
A thunk is only needed if a relocation points to the undecorated
import name.
Differential Revision: https://reviews.llvm.org/D46673
llvm-svn: 332019
Diffstat (limited to 'lld/COFF/Writer.cpp')
| -rw-r--r-- | lld/COFF/Writer.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp index 952124a81aa..b14cbb47dc7 100644 --- a/lld/COFF/Writer.cpp +++ b/lld/COFF/Writer.cpp @@ -543,14 +543,10 @@ void Writer::createImportTables() { std::string DLL = StringRef(File->DLLName).lower(); if (Config->DLLOrder.count(DLL) == 0) Config->DLLOrder[DLL] = Config->DLLOrder.size(); - } - - for (ImportFile *File : ImportFile::Instances) { - if (!File->Live) - continue; if (DefinedImportThunk *Thunk = File->ThunkSym) - TextSec->addChunk(Thunk->getChunk()); + if (File->ThunkLive) + TextSec->addChunk(Thunk->getChunk()); if (Config->DelayLoads.count(StringRef(File->DLLName).lower())) { if (!File->ThunkSym) |

