This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] PPC64 Linuxthreads tls.h M2
- From: Paul Mackerras <paulus at samba dot org>
- To: Roland McGrath <roland at redhat dot com>
- Cc: sjmunroe at us dot ibm dot com, libc-alpha at sources dot redhat dot com,Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Fri, 28 Feb 2003 13:15:20 +1100
- Subject: Re: [PATCH] PPC64 Linuxthreads tls.h M2
- References: <3E5E3DB1.60703@vnet.ibm.com><200302272048.h1RKmqE32698@magilla.sf.frob.com>
Roland McGrath writes:
> I am not having any luck testing on ppc64 right now even without TLS, so I
> don't know if my tls.h really works right. Please test it and send any
> necessary changes relative to that.
This code in sysdeps/powerpc/powerpc64/dl-machine.h looks wrong to me
(and to Alan Modra), especially the !USE_TLS branch of the ifdef:
#if defined USE_TLS && !defined RTLD_BOOTSTRAP
sym_map = RESOLVE_MAP (&sym, version, r_type);
raw_value = value = reloc->r_addend;
if (sym_map)
if (sym)
{
raw_value += sym->st_value;
value = raw_value + sym_map->l_addr;
}
#else
sym_map = RESOLVE_MAP (&sym, version, r_type);
if (sym_map)
{
if (sym)
{
raw_value = sym->st_value + sym_map->l_addr;
}
value = raw_value + reloc->r_addend;
}
#endif
In the sym != NULL && sym_map != NULL case, I think we want:
raw_value = sym->st_value + reloc->r_addend;
value = raw_value + sym_map->l_addr;
but instead we get:
raw_value = sym->st_value + sym_map->l_addr;
value = raw_value + reloc->r_addend;
I don't know if that would cause the problems you see though.
The other thing is that I can't see how we could get sym_map != NULL
but sym == NULL, so I don't see why the if (sym) statements are
needed.
Paul.