This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] PPC64 tls fixes
On Wed, Mar 05, 2003 at 04:33:41PM -0800, Roland McGrath wrote:
> > Yes. The thing that makes this question a little curly is that
> > TPREL16 relocs will only be dynamic if a shared lib is compiled
> > using the LE model. Doing so is every bit as silly as using non-PIC
> > shared libs, perhaps even more silly, so it may be better for the
> > linker just to bomb on finding these relocs.
>
> These relocs will only be produced for non-PIC code, period. Right? In
No. TPREL16 for LE model tls vars, regardless of PIC/non-PIC.
> PIC code, the only TPREL relocs are in the TOC and that's only TPREL64.
> It's IE-model non-PIC code that will be the issue. This is arguably no
> more dubious than non-PIC code in a shared library is to begin with.
TPREL64 in the TOC/GOT for IE model, again PIC/non-PIC isn't relevant.
Strictly speaking, I suppose you could generate them via assembly
in any section.
> > I added support in the linker because it was easy to do, and it's
> > generally a good idea to be permissive in what the linker accepts. On
> > the other hand, we don't want to bloat code in ld.so.
>
> What we want is a clear spec on what is kosher and to support everything
> that is valid under the ABI as specified. If non-PIC code is not kosher,
> then fine, we won't support it. But that's not what you said before.
> ld.so must support everything that is specified to be valid.
If LE in a shared lib makes any sort of sense then they're valid.
I'm happy to listen to opinions from TLS experts on this point. :)
To the best of my knowledge, this is an exhaustive list of ppc64 reloc
types that may be emitted in dynamic relocations.
R_PPC64_NONE
R_PPC64_ADDR32
R_PPC64_ADDR24
R_PPC64_ADDR16
R_PPC64_ADDR16_LO
R_PPC64_ADDR16_HI
R_PPC64_ADDR16_HA
R_PPC64_ADDR14
R_PPC64_ADDR14_BRTAKEN
R_PPC64_ADDR14_BRNTAKEN
R_PPC64_COPY
R_PPC64_GLOB_DAT
R_PPC64_JMP_SLOT
R_PPC64_RELATIVE
R_PPC64_UADDR32
R_PPC64_UADDR16
R_PPC64_REL32
R_PPC64_REL30
R_PPC64_ADDR64
R_PPC64_ADDR16_HIGHER
R_PPC64_ADDR16_HIGHERA
R_PPC64_ADDR16_HIGHEST
R_PPC64_ADDR16_HIGHESTA
R_PPC64_UADDR64
R_PPC64_REL64
R_PPC64_ADDR16_DS
R_PPC64_ADDR16_LO_DS
R_PPC64_DTPMOD64
R_PPC64_TPREL64
R_PPC64_DTPREL64
R_PPC64_TPREL16
R_PPC64_TPREL16_LO
R_PPC64_TPREL16_HI
R_PPC64_TPREL16_HA
R_PPC64_TPREL16_DS
R_PPC64_TPREL16_LO_DS
R_PPC64_TPREL16_HIGHER
R_PPC64_TPREL16_HIGHERA
R_PPC64_TPREL16_HIGHEST
R_PPC64_TPREL16_HIGHESTA
Hmm, which doesn't match dl-machine.h support.. Note in particular
that REL24 is never dynamic on ppc64.
--
Alan Modra
IBM OzLabs - Linux Technology Centre