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]

Re: Please report this bug.


On Mon, Feb 10, 2003 at 02:09:12PM -0600, Steve Munroe wrote:
> /opt/ppc64-20030210/bin/ld: BFD 2.13.90 20030210 internal error, aborting 
> at /home/bergner/binutils/binutils-20030210/bfd/elf64-ppc.c line 7706 in 
> ppc64_elf_relocate_section

Caching symbol hashes is a little tricky when versioning is involved.
The one we hit in check_relocs is typically unversioned, and later
converted to an indirect sym.  We won't ever match the indirect sym,
so my sanity checks before transforming a tls_get_addr call in
relocate_section failed.

	* elf64-ppc.c (ppc64_elf_check_relocs): Match versioned
	.__tls_get_addr too.
	(ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.83
diff -u -p -r1.83 elf64-ppc.c
--- bfd/elf64-ppc.c	9 Feb 2003 23:17:57 -0000	1.83
+++ bfd/elf64-ppc.c	11 Feb 2003 02:46:28 -0000
@@ -3726,7 +3726,10 @@ ppc64_elf_check_relocs (abfd, info, sec,
 		return FALSE;
 	      if (h == htab->tls_get_addr)
 		sec->has_tls_reloc = 1;
-	      else if (strcmp (h->root.root.string, ".__tls_get_addr") == 0)
+	      else if ((strncmp (h->root.root.string, ".__tls_get_addr", 15)
+			== 0)
+		       && (h->root.root.string[15] == 0
+			   || h->root.root.string[15] == '@'))
 		{
 		  htab->tls_get_addr = h;
 		  sec->has_tls_reloc = 1;
@@ -5171,6 +5174,18 @@ ppc64_elf_tls_setup (obfd, info)
 
   htab = ppc_hash_table (info);
   htab->tls_sec = tls;
+
+  if (htab->tls_get_addr != NULL)
+    {
+      struct elf_link_hash_entry *h = htab->tls_get_addr;
+
+      while (h->root.type == bfd_link_hash_indirect
+	     || h->root.type == bfd_link_hash_warning)
+	h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+      htab->tls_get_addr = h;
+    }
+
   return tls != NULL;
 }
 
-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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