[lld] r195289 - [PECOFF] Do not check if library is already added.

Rui Ueyama ruiu at google.com
Fri Nov 22 16:52:07 PST 2013


On Fri, Nov 22, 2013 at 4:45 PM, Shankar Easwaran
<shankare at codeaurora.org>wrote:

>
> On 11/22/2013 5:51 PM, Rui Ueyama wrote:
>
>> Thanks. I don't know if it's exactly the same, but it looks like it's
>> pretty similar. So the ideas to support that (non-Unix) semantics are
>> basically the same as Nick's.
>>
>> 1. Implement a new Resolver behavior for Darwin/COFF. The behavior would
>> be
>> like this: Make Resolver to add all symbols from library files to the
>> symbol table as it processes new files, constructing a gigantic symbol
>> table that contains all the symbols that is already resolved or *could* be
>> resolved in a library file that Resolver has seen. For a new object file,
>> Resolver looks up the symbol table for each undefined symbol in an object
>> file, and if it can be resolved in an (unparsed) library file, parse the
>> library file, and add the symbols from the file to the symbol table.
>>
> This should be controlled from the context. Its just like treating all the
> library files like --whole-archive.
> Just set the flag (--whole-archive from library files), and you should be
> done.


No, --whole-archive wouldn't work. We don't want to add the archive file
contents unless it's actually used.

 2. Create a group for all library files and add it at the end of the input
>> graph, as Nick suggested in that thread.
>>
> We already have a GroupNode which exactly does the same behavior.
>
> I am sure I would have mixed some corner cases but I think
> LinkingContext::getNextFile could have the intelligence to handle it, right
> ?


If we take (2) approach, yes.


>


>
> Thanks
>
> Shankar Easwaran
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by the Linux Foundation
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131122/074bacc8/attachment.html>


More information about the llvm-commits mailing list