LLD COFF status

I’ve been working on the new LLD COFF linker for 1.5 months so far (including history of my personal repository), and I feel like I should post an update on that matter as a followup to the previous discussion thread.

In short, it’s doing very well.

It was able to link itself from the first day when the first patch was landed. Since then, I fixed bugs and added more features. It’s now able to link everything for check{,-lld,-clang}, and all tests pass.

It’s generally 2x faster than MSVC linker. It’s 10x faster than the old LLD when linking itself. It may be the fastest COFF linker. It’s single-threaded. I have a plan to make it even faster by using multiple threads.

It consists of only 5000 lines of code including comments and blank lines. IMHO the code is simple and easy to read. (This is of course not a third-party opinion, so you are welcomed to read the code. You can skip Windows-specific code to get a whole picture.)

Advanced features
It supported dead-stripping from day one. I added preliminary ICF (Identical COMDAT Folding) support yesterday. Implementing that was basically just a one day task. Peter Collingbourne (pcc) added an experimental LTO support to the linker. The code for LTO seems to naturally fit to the other pieces of code.

When I first set the architecture, I was worried that I have made the design too simple, so it could hit a wall at some point as I wrote more code on top of that which prevented us from doing anything beyond that. I’m not too worried about that now – it looks like my design was a right choice. It’s way easier to implement new ideas than before. LTO and ICF are probably good examples.


Can we delete the old coff linker? :slight_smile:

Eventually, but not now. I need to support x86 as well as ARM. :slight_smile: