This is the mail archive of the mailing list for the binutils 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] Fix IA-32 TLS handling with symbol versioning

On Wed, Jul 31, 2002 at 09:27:18AM +0930, Alan Modra wrote:
> Won't a simpler patch like the following work?
> @@ -809,6 +809,8 @@ elf_i386_copy_indirect_symbol (dir, ind)
>        eind->dyn_relocs = NULL;
>      }
> +  edir->tls_type = eind->tls_type;
> +  eind->tls_type = GOT_UNKNOWN;
>    _bfd_elf_link_hash_copy_indirect (dir, ind);
>  }
> I'm particularly concerned that you seem to think it necessary to
> _swap_ tls_type.  Is there a code somewhere that needs to follow
> the link for an indirect symbol?
> Also the ind->root.type == bfd_link_hash_indirect test means weak
> syms won't get the tls info when you later find a tls definition.
> Maybe that's what you want.

The if test is really necessary (because this routine is sometimes
called where dir->got.refcount is > 0 while ind->got.refcount <= 0
(e.g. when one symbol is foo@@GLIBC_2.2 and the other one is foo@GLIBC_2.0),
likewise I think the bfd_link_hash_indirect test, since otherwise
_bfd_elf_link_hash_copy_indirect will really keep the refcount at the
indirect symbol, not direct), while the swap can go I think.
Will test:
    if (ind->root.type == bfd_link_hash_indirect
	&& dir->got.refcount <= 0)
	edir->tls_type = eind->tls_type;
	eind->tls_type = GOT_UNKNOWN;


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