[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:30:51 PDT 2016


>
>
> I am debugging why.

It is a consequence of the fact that a weak undefined should not fetch
archive members.

Once we have seen both a weak undefined and a lazy version of a
symbol, we have to remember that it is available in the archive but if
that nothing shows up it resolves to 0. We handle that by treating a
lazy symbols that survive as weak undef.

Which points a few interesting things :

* Your patch is using a %t.a, but it is not included.
* It would still crash without it.

So I think what needs to happen is

* Add the commands to create %t.a to the test
* Test both with and without %t.a

the check should be

if (Body.isTls() && (Body.isUndefined() || Body.isWeak()) &&
Body.symbol()->isWeak())
  return 0;


Cheers,
Rafael


More information about the llvm-commits mailing list