[PATCH] D56089: [ELF] A shared object is needed if any of its occurrences is needed

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 27 10:37:56 PST 2018


MaskRay added a comment.

In D56089#1341366 <https://reviews.llvm.org/D56089#1341366>, @ruiu wrote:

> I'm still a bit hesitant about doing this, but perhaps it is better to accept this because without this a mysterious runtime error could happen as you explained. But I wonder if you can simplify it even more. Can you do something like this? I didn't test this but I think we don't need a hash table.
>
> https://gist.github.com/rui314/92fdae6c0678528e76ad1a5e8818a57f


Thank you for considering this. The actual code addition is one line (minus comments and newline), the benefit is the fix of some potential mysterious runtime errors.

I've read your gist, but I think the quadratic behavior may be undesired. The number of `DT_NEEDED` entries is usually small (100), but some of our internal executables can have thousands of dependencies. By keeping the hash table as is, the increase of memory usage is small but the performance improve is large.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56089/new/

https://reviews.llvm.org/D56089





More information about the llvm-commits mailing list