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;
StringRef Implib;
std::vector<Export> Exports;
std::set<StringRef> DelayLoads;
std::set<std::string> DelayLoads;
// Used for /opt:icf
bool ICF = false;

View File

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

View File

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

View File

@ -1,5 +1,5 @@
# 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: llvm-readobj -coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s
# RUN: llvm-readobj -coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s