2 posts
Anyone know a small linker that is good for debugging with remedybg?
Edited by desiredusername on Reason: Initial post
Hi, I'm interested in assembler programming with small tools, and I was able to generate debug info with the Microsoft linker. The debugging with remedybg actually works.

But I thought I could go around the big .iso files from Microsoft with the linker and .lib's in it. So I tried golink.exe from, which is not only small but is okay with just using .dll's as input.

But its command line switches for debugging don't seem to work for me, and I'm not sure what tools to use anyway.

yasm -g cv8 -f win64 beep.asm
golink /debug dbg beep.obj \windows\system32\user32.dll \windows\system32\kernel32.dll

With "/debug dbg" golink doesn't include debug info (in a way that remedybg makes use of it). With "/debug coff" it also doesn't include it. Anyone know how to do it or know some set of little tools that are nice to use?

Greetings :)
Mārtiņš Možeiko
2203 posts / 1 project
Anyone know a small linker that is good for debugging with remedybg?
Afaik go uses dwarf debug info, so it won't work with remedy.

You can use lld linker from LLVM/Clang project. If you install official binaries, you can get lld-link.exe file out from installation folder and remove everything else. lld-link.exe works as standalone executable - and it is MSVC link.exe compatible. Meaning it accepts same arguments and produce normal .exe and normal .pdb file with debug symbols.

Binary in default installation is a bit large (~60MB) because it includes all possible architectures (x86, arm, powerpc, mips, ...). You can make it a bit smaller by building llvm + lld from source and include only architecture you need. For example, only x86 will give you ~40MB large .exe file.

You'd still need .lib files for import libraries for linker to work. Either create your own from .def files, or get from Windows 10 SDK. Another alternative is to get them from mingw-w64 project. You can get prebuilt msys2 package that you can unpack wherever you want. Here's direct download link: (requires zstd & tar to unpack) - inside you'll find files like libuser32.a which is the same thing as user32.lib).