aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-strtab.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2001-11-11 22:18:01 +0000
committerHans-Peter Nilsson <hp@axis.com>2001-11-11 22:18:01 +0000
commitb959dc73d0b5b0023c2d2854c2af9f4c14ec44da (patch)
treedd710fb9121c67cbf02af849ddc6db53e367e51f /bfd/elf-strtab.c
parentdcf95b472160a58c37afe705549371f3c84d57c0 (diff)
downloadgdb-b959dc73d0b5b0023c2d2854c2af9f4c14ec44da.zip
gdb-b959dc73d0b5b0023c2d2854c2af9f4c14ec44da.tar.gz
gdb-b959dc73d0b5b0023c2d2854c2af9f4c14ec44da.tar.bz2
* elf-strtab.c (_bfd_elf_strtab_finalize): Make first variable i
size_t. Rename second i to j.
Diffstat (limited to 'bfd/elf-strtab.c')
-rw-r--r--bfd/elf-strtab.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/bfd/elf-strtab.c b/bfd/elf-strtab.c
index 59a25a5..44d6fc8 100644
--- a/bfd/elf-strtab.c
+++ b/bfd/elf-strtab.c
@@ -349,7 +349,13 @@ _bfd_elf_strtab_finalize (tab)
{
struct elf_strtab_hash_entry **array, **a, **end, *e;
htab_t lasttab = NULL, last4tab = NULL;
- bfd_size_type size, amt, i;
+ bfd_size_type size, amt;
+
+ /* GCC 2.91.66 (egcs-1.1.2) on i386 miscompiles this function when i is
+ a 64-bit bfd_size_type: a 64-bit target or --enable-64-bit-bfd.
+ Besides, indexing with a long long wouldn't give anything but extra
+ cycles. */
+ size_t i;
/* Now sort the strings by length, longest first. */
array = NULL;
@@ -380,7 +386,7 @@ _bfd_elf_strtab_finalize (tab)
{
register hashval_t hash;
unsigned int c;
- unsigned int i;
+ unsigned int j;
const unsigned char *s;
PTR *p;
@@ -389,7 +395,7 @@ _bfd_elf_strtab_finalize (tab)
{
s = e->root.string + e->len - 1;
hash = 0;
- for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
{
c = *--s;
hash += c + (c << 17);