@@ -1734,6 +1734,9 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
17341734
17351735 if (auto *arg = args.getLastArg (OPT_pdb_source_path))
17361736 config->pdbSourcePath = arg->getValue ();
1737+
1738+ if (args.hasArg (OPT_fullpdbpath))
1739+ config->enableFullPdbPath = true ;
17371740 }
17381741
17391742 // Handle /pdbstripped
@@ -2345,16 +2348,18 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
23452348 // The embedded PDB path should be the absolute path to the PDB if no
23462349 // /pdbaltpath flag was passed.
23472350 if (config->pdbAltPath .empty ()) {
2348- // config->pdbAltPath = config->pdbPath;
2349-
2350- // It's important to make the path absolute and remove dots. This path
2351- // will eventually be written into the PE header, and certain Microsoft
2352- // tools won't work correctly if these assumptions are not held.
2353- // sys::fs::make_absolute(config->pdbAltPath);
2354- // sys::path::remove_dots(config->pdbAltPath);
2355- // This way below can hide our pdb path.
2356- config->pdbAltPath =
2357- sys::path::filename (config->pdbPath , sys::path::Style::windows);
2351+ if (config->enableFullPdbPath ) {
2352+ config->pdbAltPath = config->pdbPath ;
2353+ // It's important to make the path absolute and remove dots. This path
2354+ // will eventually be written into the PE header, and certain Microsoft
2355+ // tools won't work correctly if these assumptions are not held.
2356+ sys::fs::make_absolute (config->pdbAltPath );
2357+ sys::path::remove_dots (config->pdbAltPath );
2358+ } else {
2359+ // This way below can hide our pdb path.
2360+ config->pdbAltPath =
2361+ sys::path::filename (config->pdbPath , sys::path::Style::windows);
2362+ }
23582363 } else {
23592364 // Don't do this earlier, so that ctx.OutputFile is ready.
23602365 parsePDBAltPath ();
0 commit comments