This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Committed: fix typo in elf32-cris.c:elf_cris_got_elt_size.
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: binutils at sourceware dot org
- Date: Mon, 15 Dec 2008 03:14:26 +0100
- Subject: Committed: fix typo in elf32-cris.c:elf_cris_got_elt_size.
Noticed while fixing a "bigger" bug. The assert below trigs a
number of times in the ld testsuite without the actual fix:
FAIL: ld-cris/tls-err-56
FAIL: ld-cris/tls-err-62
FAIL: ld-cris/tls-gc-76
FAIL: ld-cris/tls-local-54
FAIL: ld-cris/tls-local-57
FAIL: ld-cris/tls-local-58
FAIL: ld-cris/tls-local-59
FAIL: ld-cris/tls-local-60
FAIL: ld-cris/tls-local-61
Committed.
bfd:
* elf32-cris.c (elf_cris_got_elt_size) <symtab_hdr>: Initialize
using ibfd, not abfd.
Index: elf32-cris.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cris.c,v
retrieving revision 1.88
diff -p -u -r1.88 elf32-cris.c
--- elf32-cris.c 25 Nov 2008 13:03:55 -0000 1.88
+++ elf32-cris.c 15 Dec 2008 00:49:33 -0000
@@ -4094,13 +4181,13 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBU
unsigned long symndx)
{
struct elf_link_hash_entry *h = (struct elf_link_hash_entry *) hr;
- Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
bfd_vma eltsiz = 0;
/* We may have one regular GOT entry or up to two TLS GOT
entries. */
if (h == NULL)
{
+ Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
bfd_signed_vma *local_got_refcounts = elf_local_got_refcounts (ibfd);
BFD_ASSERT (local_got_refcounts != NULL);
@@ -4137,6 +4224,9 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBU
eltsiz += 4;
}
+ /* We're only called when h->got.refcount is non-zero, so we must
+ have a non-zero size. */
+ BFD_ASSERT (eltsiz != 0);
return eltsiz;
}
brgds, H-P