Thank you very much for this patch! I managed to get separate debug files working. Besides this merge request, [pacman](https://gitlab.archlinux.org/yan12125/pacman/-/commits/pe-symbols) and [wine package](https://gitlab.archlinux.org/archlinux/packaging/packages/wine/-/tree/strip-...) changes are also needed.
At the pacman side, I need to [skip creation of some symlinks](https://gitlab.archlinux.org/yan12125/pacman/-/commit/0a0c5dc57d685c58715519...). I'm not sure what's the purpose of `/usr/lib/debug/.build-id/xxx/yyy` links (those that do not end with `.debug`) for ELF files, and apparently they confuse dbghelp.
At the wine package side, I need to replace `-g` in `CROSSCFLAGS` and `CROSSCXXFLAGS` with `-gdwarf-4`. I understand that wine supports up to DWARF 4, while I remember wine automatically used `-gdwarf-4` when given `-g` some time ago. If this is an intended change, maybe documenting it somewhere is good.
if binutils isn't compiled with PE support (this is apparently the Arch case)
To clarify, I was not sure if it's okay to just use binutils instead of mingw-w64-binutils. It seems fine after more testing.