This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold RFC] Do not generate dynamic reloc for unresolved TLS symbol
- From: Alan Modra <amodra at gmail dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>, Ian Lance Taylor <iant at google dot com>, Jing Yu <jingyu at google dot com>, Han Shen <shenhan at google dot com>, Doug Kwan <dougkwan at google dot com>, David Miller <davem at davemloft dot net>
- Date: Thu, 29 Jan 2015 13:51:40 +1030
- Subject: Re: [gold RFC] Do not generate dynamic reloc for unresolved TLS symbol
- Authentication-results: sourceware.org; auth=none
- References: <CAHACq4oi4UT7LLv-vz5+ocpkPU8zwtyOQ8Gas_S3WdB_7WgN2w at mail dot gmail dot com> <20141218224458 dot GC31055 at bubble dot grove dot modra dot org> <CAHACq4q3UBVdhiXzeT6e2H0t-c_DA926C9s61+-YAsYzmyTs2g at mail dot gmail dot com> <CAHACq4r2tZ9g=uSH+PEDovrUdy4FHFVYmeZXxYiPQvqapdCzJw at mail dot gmail dot com>
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