This is the mail archive of the binutils@sources.redhat.com 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]

[PATCH] Fix IA-32 TLS handling with symbol versioning


Hi!

If _bfd_elf_link_hash_copy_indirect is swapping h->got.offset values,
tls_type needs to match that, otherwise the backend gets confused with
GOT_UNKNOWN values where it is not expecting them.

2002-07-30  Jakub Jelinek  <jakub@redhat.com>

	* elf32-i386.c (elf_i386_copy_indirect_symbol): Swap tls_type
	if _bfd_elf_link_hash_copy_indirect will swap got.refcount.

--- bfd/elf32-i386.c.jj	2002-07-30 16:14:55.000000000 +0200
+++ bfd/elf32-i386.c	2002-07-30 18:06:40.000000000 +0200
@@ -809,6 +809,14 @@ elf_i386_copy_indirect_symbol (dir, ind)
       eind->dyn_relocs = NULL;
     }
 
+  if (ind->root.type == bfd_link_hash_indirect
+      && dir->got.refcount <= 0)
+    {
+      int type = edir->tls_type;
+
+      edir->tls_type = eind->tls_type;
+      eind->tls_type = type;
+    }
   _bfd_elf_link_hash_copy_indirect (dir, ind);
 }
 

	Jakub


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