[llvm-dev] Make LLD output COFF relocatable object file (like ELF's -r does). How much work is required to implement this?

Rui Ueyama via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 9 16:39:25 PDT 2017


As far as I know, no one has ever tried to add the -r option to the lld
COFF linker. It shouldn't be super hard to add it to the COFF linker, but
from our experience of implementing it to lld ELF linker, I can say that it
was tricky and somewhat fragile. We had to add a number of small pieces of
code here and there.

We wanted to support it in the ELF linker because that's an existing
feature and people are actually using it. Otherwise, we wouldn't have added
it. So, what is the motivation of adding the feature to the COFF linker? I
don't think MSVC linker supports it.

(For those who are not familiar with -r,  the option is to make the linker
emit a .o file instead of an executable or a shared library. With the
option, you can combine multiple object files into one object file.)

On Mon, Oct 9, 2017 at 8:02 AM, kyra via llvm-dev <llvm-dev at lists.llvm.org>
wrote:

> Hi,
>
> How far are we from having '-r' in the LLD COFF linker?
> I'd try to implement this if not too much effort is required.
> Any suggestions and/or pointers?
>
> Cheers,
> Kyra
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171009/0b07fdb6/attachment.html>


More information about the llvm-dev mailing list