COFF: Fix a bug that /delayload was case-sensitive.

llvm-svn: 241316
This commit is contained in:
Rui Ueyama 2015-07-03 01:40:14 +00:00
parent 6f9cfaf85b
commit 7a247ee242
4 changed files with 4 additions and 4 deletions

View File

@ -59,7 +59,7 @@ struct Configuration {
bool DLL = false; bool DLL = false;
StringRef Implib; StringRef Implib;
std::vector<Export> Exports; std::vector<Export> Exports;
std::set<StringRef> DelayLoads; std::set<std::string> DelayLoads;
// Used for /opt:icf // Used for /opt:icf
bool ICF = false; bool ICF = false;

View File

@ -421,7 +421,7 @@ bool LinkerDriver::link(llvm::ArrayRef<const char *> ArgsArr) {
// Handle /delayload // Handle /delayload
for (auto *Arg : Args.filtered(OPT_delayload)) { for (auto *Arg : Args.filtered(OPT_delayload)) {
Config->DelayLoads.insert(Arg->getValue()); Config->DelayLoads.insert(StringRef(Arg->getValue()).lower());
addUndefined("__delayLoadHelper2"); addUndefined("__delayLoadHelper2");
} }

View File

@ -222,7 +222,7 @@ void Writer::createImportTables() {
Text->addChunk(cast<DefinedImportThunk>(B)->getChunk()); Text->addChunk(cast<DefinedImportThunk>(B)->getChunk());
continue; continue;
} }
if (Config->DelayLoads.count(Import->getDLLName())) { if (Config->DelayLoads.count(Import->getDLLName().lower())) {
DelayIdata.add(Import); DelayIdata.add(Import);
} else { } else {
Idata.add(Import); Idata.add(Import);

View File

@ -1,5 +1,5 @@
# RUN: lld -flavor link2 /out:%t.exe /entry:main /subsystem:console \ # RUN: lld -flavor link2 /out:%t.exe /entry:main /subsystem:console \
# RUN: %p/Inputs/hello64.obj %p/Inputs/std64.lib /delayload:std64.dll \ # RUN: %p/Inputs/hello64.obj %p/Inputs/std64.lib /delayload:std64.DLL \
# RUN: /alternatename:__delayLoadHelper2=main # RUN: /alternatename:__delayLoadHelper2=main
# RUN: llvm-readobj -coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s # RUN: llvm-readobj -coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s
# RUN: llvm-readobj -coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s # RUN: llvm-readobj -coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s