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

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 07:09:05 PDT 2016


On 22 September 2016 at 23:42, Davide Italiano <dccitaliano at gmail.com> wrote:
> 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


I am debugging why.

> Still, maybe this is not the best place to check.
>
>
> https://reviews.llvm.org/D24832
>
>
>


More information about the llvm-commits mailing list