This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -ftls-model docs/implementation inconsistency
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Alexander Monakov <amonakov at ispras dot ru>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 19 Jul 2013 17:58:58 +0200
- Subject: Re: -ftls-model docs/implementation inconsistency
- References: <alpine dot LNX dot 2 dot 00 dot 1307191846470 dot 1061 at monopod dot intra dot ispras dot ru> <20130719154105 dot GM23578 at laptop dot redhat dot com> <alpine dot LNX dot 2 dot 00 dot 1307191945350 dot 1061 at monopod dot intra dot ispras dot ru>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jul 19, 2013 at 07:55:35PM +0400, Alexander Monakov wrote:
> On Fri, 19 Jul 2013, Jakub Jelinek wrote:
> > Furthermore, on Linux you can dlopen even libraries with initial-exec TLS
> > model in it (as long as they don't use too big TLS sections).
>
> This is the failure I'm referring to ("cannot load any more object ..."):
> http://repo.or.cz/w/glibc.git/blob/HEAD:/elf/dl-open.c#l525
>
> > So the short answer is, don't do this, especially if you are using TLS.
>
> Sure, *I* don't do that. The problem is, some GCC users do that, and we
> should either fix the documentation, or fix the implementation to match the
> documentation and give them a smoother rope. I'd do the latter, but I don't
> see if there were any reasons for the current implementation to be the way it
> is, and hence I'm asking on the mailing list.
The change of memory models based on flag_shlib is completely intentional,
it is similar to the linker TLS optimizations but at the compiler level,
so if you want to ad some comment to documentation, that is fine, but
I don't see anything to fix.
Jakub