[PATCH 1/2] ld: Add --pdb option
Mark Harmstone
mark@harmstone.com
Mon Oct 3 16:57:32 GMT 2022
Hi Martin,
> As I assume you're aware, lld's mingw port also supports PDB generation - and the description of this option also sounds like it's chosen to match lld's option for outputting PDB files - that's good!
Yes, that's right. One notable difference is that the parameter here is optional, unlike with lld, making it a lot easier to fit this into e.g. CMake toolchain files or LDFLAGS.
> The testcase only seemed to exercise the form --pdb=<explicitname>, so I thought I'd ask just for clarity: I guess the other forms of specifying the option, e.g. "--pdb <explicitname>" also does the same - same thing for setting the option with just one leading dash, "-pdb=<explicitname>" (I guess it's a getopt feature that allows that as long as it isn't ambiguous with single-letter options?), as well as the form "-pdb=" or "--pdb=" for requesting it to set the default name?
Apparently provided that the option doesn't begin with an O, you can use either single dashes or double dashes. It looks like the equals sign is mandatory when providing optional parameters, otherwise it interprets the filename as another parameter. But it does mean that the form "-pdb=out.pdb" will work on both ld and lld, which I think is the most important thing.
Mark
More information about the Binutils
mailing list