forked from OSchip/llvm-project
COFF: Fix a bug that /delayload was case-sensitive.
llvm-svn: 241316
This commit is contained in:
parent
6f9cfaf85b
commit
7a247ee242
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue