[PATCH] D38513: [LLD] [RFC] [COFF] Add support for GNU binutils import libraries

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 13:54:53 PDT 2017


mstorsjo added a comment.

In https://reviews.llvm.org/D38513#887477, @ruiu wrote:

> Import library files are tricky, and I don't fully understand how it works in the MSVC linker. It seems that because import libraries contain sections such as .idata$2, .idata$3, etc., they would be "naturally" processed and sorted in the MSVC linker, and as a result a correct output would be created. But I couldn't figure that out. So, lld implements a special logic for the import library.


Ok, thanks for the honest comment on this part!

> I have two questions:
> 
> 1. Do you think you can figure out what MSVC does for the import libary?

I guess I'd have to try to reverse-engineer the logic somehow, alternatively try to look at what GNU binutils does in case that gives any clues.

This whole patch turned out to be a much larger task than I had anticipated, so I posted it early in case anyone of you would have had good insights on how to implement it. I'll probably continue with this with a bit lower priority and focus on other easier features inbetween though.


https://reviews.llvm.org/D38513





More information about the llvm-commits mailing list