This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: BFD 2.16.1 "assertion failure" and "internal error"
- From: Nick Clifton <nickc at redhat dot com>
- To: Daniel Marques <marques at cs dot cornell dot edu>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 13 Jul 2005 16:59:17 +0100
- Subject: Re: BFD 2.16.1 "assertion failure" and "internal error"
- References: <42B99871.7010000@cs.cornell.edu> <42CA8C78.4070308@redhat.com> <42CA8CB7.90805@cs.cornell.edu> <42CAA3E8.3040700@redhat.com> <42CABADB.3030305@cs.cornell.edu> <42CBB314.3050907@redhat.com> <42CC04AF.6090700@cs.cornell.edu> <42CCF885.6030400@redhat.com> <42CD7DF2.5030204@cs.cornell.edu> <42D1C355.30202@cs.cornell.edu> <42D4AAA8.3050106@cs.cornell.edu>
Hi Dan,
I have generated a set of .o files that binutils can handle
http://www.cs.cornell.edu/marques/bfdexample/alpha.tar.
objcopy a.o
BFD: BFD 2.16.1 assertion fail ../../binutils-2.16.1/bfd/coff-alpha.c:607
Thanks. This failure appears to be due to an overly conservative
assertion. Please try the attached patch which fixes the problem for
me. (The patch changes a magic value from 14 to 15. There is no
comment explaining where this magic value came from, which is another
reason why I hate seeing raw constants in source code).
Cheers
Nick
Index: bfd/coff-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-alpha.c,v
retrieving revision 1.31
diff -c -3 -p -r1.31 coff-alpha.c
*** bfd/coff-alpha.c 6 Jul 2005 10:35:41 -0000 1.31
--- bfd/coff-alpha.c 13 Jul 2005 15:52:20 -0000
*************** alpha_ecoff_swap_reloc_out (abfd, intern
*** 604,610 ****
}
BFD_ASSERT (intern->r_extern
! || (intern->r_symndx >= 0 && intern->r_symndx <= 14));
H_PUT_64 (abfd, intern->r_vaddr, ext->r_vaddr);
H_PUT_32 (abfd, symndx, ext->r_symndx);
--- 604,610 ----
}
BFD_ASSERT (intern->r_extern
! || (intern->r_symndx >= 0 && intern->r_symndx <= 15));
H_PUT_64 (abfd, intern->r_vaddr, ext->r_vaddr);
H_PUT_32 (abfd, symndx, ext->r_symndx);