This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PPC64 Linuxthreads tls.h M2


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]