Fix pdb-linker-module test on linux.

lld-link is apparently a symlink to lld.  Our pdb writing code
uses llvm::sys::fs::getMainExecutable() and writes that value
into the PDB, which will resolve symlinks etc.  But what we
really want is the exact value of argv[0], which matches what
the MS linker does.  Fix this by just writing argv[0] instead
of calling getMainExecutable.

llvm-svn: 307592
This commit is contained in:
Zachary Turner 2017-07-10 21:09:11 +00:00
parent 07f6efddc0
commit 77f23b9c21
1 changed files with 1 additions and 3 deletions

View File

@ -428,9 +428,7 @@ static void addLinkerModuleSymbols(StringRef Path,
llvm::sys::fs::current_path(cwd); llvm::sys::fs::current_path(cwd);
EBS.Fields.push_back(cwd); EBS.Fields.push_back(cwd);
EBS.Fields.push_back("exe"); EBS.Fields.push_back("exe");
std::string Exe = EBS.Fields.push_back(Config->Argv[0]);
llvm::sys::fs::getMainExecutable(Config->Argv[0].data(), nullptr);
EBS.Fields.push_back(Exe);
EBS.Fields.push_back("pdb"); EBS.Fields.push_back("pdb");
EBS.Fields.push_back(Path); EBS.Fields.push_back(Path);
EBS.Fields.push_back("cmd"); EBS.Fields.push_back("cmd");