ldso: powerpc: assign static TLS before relocating TPREL32
An initial-exec TLS variable in a dlopened module reads garbage on
powerpc. tst-tls15 loads such a module and expects its variable to be
zero; it returns 205.
R_PPC_TPREL32 is relocated with tls_tpnt->l_tls_offset, but a module that
was not part of the initial link has no offset yet -- l_tls_offset is
still NO_TLS_OFFSET, which is 0 here, so the access lands 0x7000 below
the thread pointer instead of inside the module's block. The other
eighteen architectures with TLS relocations all call CHECK_STATIC_TLS
first, which assigns an offset out of the static TLS surplus; powerpc was
the only one that did not.
Verified on powerpc/6.1.60 under qemu-system-ppc: tst-tls15 and
tst-tls15-O2 pass.
Signed-off-by: Ramin Moussavi <lordrasmus@gmail.com>