[PATCH] D24832: [ELF] Resolve weak undefined TLS symbols when no phdr is available

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 20:42:51 PDT 2016


davide added a comment.

I don't think the invariant you point out is respected (we should never call getSymVA() on a Lazy symbol).
I was lazy, and to convince myself I put the following assertion in the code:

  diff --git a/ELF/InputSection.cpp b/ELF/InputSection.cpp
  index 3cc6ce5..b44d2d9 100644
  --- a/ELF/InputSection.cpp
  +++ b/ELF/InputSection.cpp
  @@ -185,6 +185,7 @@ template <class ELFT>
   static typename ELFT::uint getSymVA(uint32_t Type, typename ELFT::uint A,
                                       typename ELFT::uint P,
                                       const SymbolBody &Body, RelExpr Expr) {
  +  assert (!Body.isLazy() && "patatino");
     switch (Expr) {
     case R_HINT:
       llvm_unreachable("cannot relocate hint relocs");

and saw three tests failing:

  ********************
  Testing Time: 17.63s
  ********************
  Failing Tests (3):
      lld :: ELF/archive.s
      lld :: ELF/lto/undef-weak.ll
      lld :: ELF/tls-in-archive.s

Still, maybe this is not the best place to check.


https://reviews.llvm.org/D24832





More information about the llvm-commits mailing list