[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
Thu Oct 12 11:43:11 PDT 2017


mstorsjo added a comment.

In https://reviews.llvm.org/D38513#896073, @smeenai wrote:

> My hypothesis is that link might special-case zero-sized sections, but I have no evidence to back that up yet.


I don't think that's it. Consider linking two separate GNU import libraries in the same module; if just piling up section chunks into `.idata$5` as they are referenced, you'd have an IAT with entries mixed from both. So some sort of grouping per import library is needed, but the exact conditions for it aren't really known. Perhaps only ordering `.idata$*` chunks like this, but not other ones?

One could try to read the source of GNU ld, but i'm not sure how easy it is to find the answer to the question by sifting through that source...


https://reviews.llvm.org/D38513





More information about the llvm-commits mailing list