Questions & Answers

Partial linking or Combine multiple object files to one on Windows

I am trying to redefine symbols on a static library on Windows, using llvm-objcopy, but because of it's limitation on COFF format support, I can't execute --redefine-syms on .lib file, instead I have to unpack the archive and execute the command on every individual object file. So far so good, but the problem is when I have 1000+ object files, it takes around 4 minutes on Windows to operate on each of them. Is there any way on Windows to combine multiple object files together into single one? or Partial link them?

I know that there is similar option on Unix/Linux with ld -r command, but I can't find something similar for Windows.

2023-01-21 00:00:07
For starters you could use ld. It's just a program from Binutils and can be built for Windows. If you install software like Cygwin or MSYS you may be able to install a prepackaged version. Conversely you could use it from Linux (think WSL) on your local drive, provided it was built for support of COFF and your target architecture(s).
Answers(0) :