This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Mips, -fpie and TLS management
On Thu, Nov 20, 2008 at 05:28:16PM +0100, Joel Porquet wrote:
> Gcc is using local-exec tls model instead of global-dynamic. The
> option -fpie is supposed to act as -fpic though (dixit the manual).
> Here is the first problem...
Could you explain the problem with this? The choice of local-exec vs
global-dynamic does not affect whether code is position independent.
It's a difference between linking an executable versus linking a
shared library; this is one of the distinctions between -fpie and
-fpic.
> But then readelf tells me:
>
> Relocation section '.rel.dyn' at offset 0x3d4 contains 2 entries:
> Offset Info Type Sym.Value Sym. Name
> 00000000 00000000 R_MIPS_NONE
> 5ffe1460 00000026 R_MIPS_TLS_DTPMOD
>
> The symbol name is missing and most of all, the offset type is missing
> too: there should be a R_MIPS_TLS_DTPREL type with the
> R_MIPS_TLS_DTPMOD, since for each tls variable in global dynamic
> model, tls_get_addr must receive the module index and the offset. Here
> is the second problem...
That's because this is the local dynamic model.
--
Daniel Jacobowitz
CodeSourcery