What's necessary to get a correct PDB output from LLVM + lld?

In my compiler I use LLVM + lld. I just generate debug info normally and it works fine for linux / macos, but for PDB/COFF although I get a pdb it’s not really working correctly.

I’ve tried to find some docs on this with no success. I’m using the LLVM-C API and invoking lld-link with /DEBUG:FULL.

I get a lot of “section name … is longer than than 8 characters …” warnings if that helps.