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]

New miscompilation of elf-strtab.c:_bfd_elf_strtab_finalize


Once more egcs-1.1.2 miscompiles elf-strtab.c:_bfd_elf_strtab_finalize.
The failure looks the same as in
<URL:http://sources.redhat.com/ml/binutils/2001-11/msg00274.html>.  This
time there's unfortunately no obvious improvement that can "legitimately"
work aroung the failure.  I can get it to work with an ugly placed cast:

*** elf-strtab.c	Fri Dec 21 09:34:07 2001
--- /tmp/elf-strtab.c	Fri Dec 21 18:26:29 2001
*************** alloc_failure:
*** 443,449 ****
      {
        e = tab->array[i];
        if (e->refcount && ! e->len)
! 	e->u.index = e->u.suffix->u.index
! 		     + (e->u.suffix->len - strlen (e->root.string) - 1);
      }
  }
--- 443,451 ----
      {
        e = tab->array[i];
        if (e->refcount && ! e->len)
! 	e->u.index
! 	  = (e->u.suffix->u.index
! 	     + ((bfd_size_type) e->u.suffix->len
! 		- strlen (e->root.string) - 1));
      }
  }

but not by (the slightly less ugly) casting the outer non-bfd_size_type
expression or breaking it out to a local variable.  I've had enough; this
is getting too ugly for my taste.  egcs-1.1.2 is obsolete, being two
versions back, so I don't think we really need to support it.  I'd like to
autoconf away the losing combination: egcs-1.1.2 and 64-bit bfd and an
i386-host.  Thoughts?

brgds, H-P
PS. gcc-2.95 has no problem here. gcc-2.7.2 works too for some strange
reason.


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