Object: preserve more information about DEF file

Preserve the actual library name as provided by the user.  This is
required to properly replicate link's behaviour about the module import
name handling.  This requires an associated change to lld for updating
the tests for the proper behaviour for the import library module name
handling in various cases.

Associated tests will be part of the lld change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308406 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool
2017-07-19 02:01:22 +00:00
parent 03e0349c15
commit abab2b9ec9
2 changed files with 9 additions and 4 deletions
+8 -4
View File
@@ -188,13 +188,17 @@ private:
std::string Name;
if (Error Err = parseName(&Name, &Info.ImageBase))
return Err;
// Append the appropriate file extension if not already present.
if (!sys::path::has_extension(Name))
Name += IsDll ? ".dll" : ".exe";
Info.ImportName = Name;
// Set the output file, but don't override /out if it was already passed.
if (Info.OutputFile.empty())
if (Info.OutputFile.empty()) {
Info.OutputFile = Name;
// Append the appropriate file extension if not already present.
if (!sys::path::has_extension(Name))
Info.OutputFile += IsDll ? ".dll" : ".exe";
}
return Error::success();
}
case KwVersion: