[PATCH] D49113: [WebAssemlby] Set IsUsedInRegularObj correctly for undefined data symbols

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 10:05:20 PDT 2018


sbc100 added a comment.

Yes, its correct, I believe.  We were already doing it for undefined functions, just not data symbols.  In the ELF loader we do it for all symbols in the ::insert function.  I think I will do a followup to do it the same way here.

The example I have the I think shows it to be correct:

1. Regular obj inserted undefined symbol.
2. bitcode obj defines the symbols and replaces it.
3. LTO happens, at which point symbol can be discarded if !IsUsedInRegularObj

So (1) needs to set IsUsedInRegularObj otherwise the symbol can be discarded in (3) and the result will be an undefined symbol.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D49113





More information about the llvm-commits mailing list