[PATCH] D77280: [ELF] Make --version-script/--dynamic-list work for lazy symbols fetched by LTO libcalls

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 3 16:17:04 PDT 2020


MaskRay added a comment.

In D77280#1959076 <https://reviews.llvm.org/D77280#1959076>, @grimar wrote:

> I have no more comments, I'd like someone more familar with LTO to take a look.


There is not much about LTO. Version script scanning happens before LTO because LTO needs to know what symbols are local and can thus internalize them. Some library call undefined references (e.g. `__udivti3`) are not recorded in the symbol table of bitcode files but they may be generated on the fly. The reference will fetch the lazy `__udivti3`. We thus need to track the version of lazy libcall symbol as well.

  if (!config->relocatable)
    symtab->scanVersionScript();
  
  // Do link-time optimization if given files are LLVM bitcode files.
  // This compiles bitcode files into real object files.
  //
  // With this the symbol table should be complete. After this, no new names
  // except a few linker-synthesized ones will be added to the symbol table.
  compileBitcodeFiles<ELFT>();


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77280





More information about the llvm-commits mailing list