[PATCH] Fix Weak External symbol handling.

Rui Ueyama ruiu at google.com
Wed Nov 20 09:36:54 PST 2013


On Wed, Nov 20, 2013 at 9:02 AM, Shankar Kalpathi Easwaran <
shankarke at gmail.com> wrote:

>
>   The main problem I have here understanding is
>
>   handleFile is called when looking at kindObject files. If I have an
> undefined symbol in the object file with a fallback atom, i think its too
> early to use the fallback atom instead of the undefined atom, when looking
> at that single object file.
>
>   For example :
>
>   Say you have
>
>   lld -flavor link hello.o libc.a (the link line may not look like this,
> but only taking this as an example).
>
>   Currently when the resolver reads in hello.o and say printf has a
> fallback to puts, its too early to replace undefined atom printf with puts,
> when you have just read hello.o.
>
>   Does link.exe have this same behavior ?
>

Yes. If hello.o contains symbol "printf" with fallback symbol "puts",
"puts" will be searched in libc.a. "printf" won't be searched. If libc.a
has only "printf" and does not have "puts", it will fail to link.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131120/3b71a778/attachment.html>


More information about the llvm-commits mailing list