[gold RFC] Do not generate dynamic reloc for unresolved TLS symbol

Alan Modra amodra@gmail.com
Thu Jan 29 03:21:00 GMT 2015


On Wed, Jan 28, 2015 at 03:57:54PM -0800, Cary Coutant wrote:
> created. This patch allows the IE-to-LE optimization for an undefined symbol
> when building an executable,

Thinking out loud here.  That looks like a contradiction to me.  If
the symbol is undefined, how can it be local-exec?

Oh, is this the undefined weak case?  Hmm, seems to me that undefined
weaks don't play well with TLS symbols..  Even for initial-exec you
won't have its address resolve to zero as you do with non-TLS symbols,
because tp is always added.  So
  if (foo)
    {
      /* Do something when foo is defined.  */
    }
will "Do something" even when foo is undefined.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list