This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Please report this bug.
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Steve Munroe <sjmunroe at us dot ibm dot com>, binutils at sources dot redhat dot com
- Cc: Peter Bergner <bergner at us dot ibm dot com>
- Date: Tue, 11 Feb 2003 13:32:09 +1030
- Subject: Re: Please report this bug.
- References: <OF33C49DE1.4F88D19F-ON86256CC9.006B0E87-86256CC9.006EB579@rchland.ibm.com>
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