[LLVMdev] Can we establish layering for the LLD libraries? Current state is a bit of a mess...

Rui Ueyama ruiu at google.com
Tue Jan 20 19:16:46 PST 2015


On Tue, Jan 20, 2015 at 6:53 PM, Nick Kledzik <kledzik at apple.com> wrote:

>
> On Jan 20, 2015, at 6:37 PM, Rui Ueyama <ruiu at google.com> wrote:
>
> If my understanding is correct, the dependencies dependencies between
>>> components in LLD should be like this:
>>>
>>> Config: (nothing)
>>> Core: Config
>>> Driver: Core Passes ReaderWriter
>>> Passes: Core ReaderWriter
>>> ReaderWriter: Core (and Driver?)
>>>
>>> I don't want ReaderWriter to depend on Driver, but it may be unavoidable
>>> because of .drectve section in PE/COFF which contains command line options.
>>>
>>
>> Well, it *can't* depend on Driver if Driver depends on ReaderWriter.
>>
>
> Oh that's true. Then the only thing we can do is to combine Driver and
> ReaderWriter to make it one library? It's far from ideal and feels wrong
> though.
>
>
> Can we finesse this by having the WinLinkDriver register a “parse”
> function pointer with PECOFFLinkingContext.  Then have FileCOFF just call
> the registered parse function in the PECOFFLinkingContext?
>

We could and I thought about that. The problem is that it's quite common to
have a .drectve section for a COFF file, so PE/COFF ReaderWriter would be
mostly unusable if you don't register the parser. If you always have to
register, it would spoil the meaning of splitting them up.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150120/31218ddb/attachment.html>


More information about the llvm-dev mailing list