Discussion:
Linking with relative path name for PDB's
(too old to reply)
Quan Qiu
2008-02-14 12:01:54 UTC
Permalink
When link builds binaries, the full path name of PDB files are coded
into EXE files.

For most applications, this is true. As for binaries released by
Microsoft, only the basename of the binary is revealed. Examples
below.

Would someone please help about which linker options or something to
set
to eliminate the full path info from the built binaries?

Examples:

C:\Program Files\Mozilla Firefox>
link -dump -headers *.exe | findstr /c:pdb /c:linker
6.00 linker version
474CD9CE cv 6B 00000000 74A600 Format: NB10,
474CD9CE, 1, c:\
builds\tinderbox\Fx-Mozilla1.8-Release\WINNT_5.2_Depend\mozilla
\browser
\app\fire
fox.pdb
6.00 linker version
474CD810 cv 82 00000000 1EE00 Format: NB10,
474CD80E, 2, c:\
builds\tinderbox\Fx-Mozilla1.8-Release\WINNT_5.2_Depend\mozilla
\toolkit
\mozapps\
update\src\updater\updater.pdb
6.00 linker version
474CD834 cv 74 00000000 10800 Format: NB10,
474CD834, 1, c:\
builds\tinderbox\Fx-Mozilla1.8-Release\WINNT_5.2_Depend\mozilla
\xpinstall\cleanu
p\xpicleanup.pdb


C:\Program Files\Windows NT>
link -dump -headers *.exe | findstr /c:pdb /c:linker
7.10 linker version
41107CE7 cv 23 00008938 7D38 Format: RSDS,
{7FDC3F15-8EF9-4
AFA-9859-BF6C8DE9083B}, 1, dialer.pdb
7.00 linker version
3B7D8429 cv 1D 0000109C 49C Format: NB10,
3B7D8429, 1, HYP
ERTRM.pdb
John Dallman
2008-02-19 20:00:00 UTC
Permalink
In article
Post by Quan Qiu
When link builds binaries, the full path name of PDB files are coded
into EXE files.
For most applications, this is true. As for binaries released by
Microsoft, only the basename of the binary is revealed. Examples
below.
Would someone please help about which linker options or something to
set to eliminate the full path info from the built binaries?
There's an undocumented option: /pdbpath:none

To build and inspect a hello, world program, do this:

cl /MD /Z7 world.c /link /pdbpath:none
dumpbin /headers world.exe

The basic info came from from: http://www.geoffchappell.com
--
John Dallman ***@cix.co.uk
"C++ - the FORTRAN of the early 21st century."
Quan Qiu
2008-03-05 00:46:40 UTC
Permalink
Post by John Dallman
There's an undocumented option: /pdbpath:none
cl /MD /Z7 world.c /link /pdbpath:none
dumpbin /headers world.exe
The basic info came from from:http://www.geoffchappell.com
Thanks! That works great!

Loading...